<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20315">
<style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst,
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Meiryo', 'Calibri', 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:11.4975pt;">
<div>いつも大変お世話になっております。</div><div>阿形と申します。</div><div><br></div><div>現在、S2Unit4を使用してテストを行っております。</div><div>ですが中々テストが通らず苦心しています。</div><div>お手数おかけしますが、見落としている箇所</div><div>見直したほうが良い箇所がありましたら教えて</div><div>いただきたく、よろしくお願い致します。</div><div><br></div><div>トレースのコピー</div><div><br></div><div>java.lang.AssertionError: OUTPUT expected:<Expected:HOZENNO, BUMONCODE, SETSUBICODE, HASSEINICHIJI, SYUFUKUBI, SYAINCODE<br>{26, 0001, 000001, 14-01-10, 14-01-10, 0297}<br>{28, 0001, 000003, 14-01-14, 14-01-14, 0297}<br>{29, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{36, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>{19, 0001, 000001, 14-01-02, 14-01-02, 0295}<br>{33, 0001, 000001, 14-01-15, 14-01-15, 0297}<br>{38, 0001, 000001, 14-01-24, 14-01-24, 0297}<br>{31, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>{32, 0001, 000001, 14-01-15, 14-01-15, 0297}<br>{20, 0002, 000001, 14-01-02, 14-01-02, 0296}<br>{21, 0001, 000001, 14-01-06, 14-01-06, 0297}<br>{22, 0001, 000001, 14-01-07, 14-01-07, 0295}<br>{23, 0001, 000001, 14-01-06, 14-01-06, 0297}<br>{24, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{25, 0001, 000001, 14-01-10, 14-01-10, 0297}<br>{27, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{30, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{34, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{35, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>{37, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>{39, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>{40, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>{41, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>{18, 0001, 000001, 14-01-02, 14-01-02, 0295}<br>> but was:<[Lequipment.system.entity.Emtbl;@25592bea><br> at org.junit.Assert.fail(Assert.java:74)<br> at org.junit.Assert.failNotEquals(Assert.java:448)<br> at org.junit.Assert.assertEquals(Assert.java:102)<br> at equipment.system.web.emtbl.EmtblListPageTest.testDoOnceSearch(EmtblListPageTest.java:72)<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br> at java.lang.reflect.Method.invoke(Method.java:601)<br> at org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)<br> at org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)<br> at org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)<br> at org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)<br> at org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)<br> at org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)<br> at org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)<br> at org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)<br> at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)<br> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)<br> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)</div><div><br></div><div>テストコード</div><div><br></div><div>package equipment.system.web.emtbl;</div><div><br></div><div>import static org.junit.Assert.*;</div><div><br></div><div>import java.text.DateFormat;<br>import java.text.ParseException;<br>import java.util.Date;</div><div><br></div><div>import org.junit.Before;<br>import org.junit.Test;<br>import org.junit.runner.RunWith;<br>import org.seasar.extension.dataset.DataSet;<br>import org.seasar.framework.container.annotation.tiger.Binding;<br>import org.seasar.framework.unit.DataAccessor;<br>import org.seasar.framework.unit.Seasar2;<br>import org.seasar.framework.unit.TestContext;</div><div><br></div><div>import equipment.system.dao.EmtblDao;<br>import equipment.system.dto.EmtblDto;<br>import equipment.system.entity.Emtbl;</div><div><br></div><div>@RunWith(Seasar2.class)<br>public class EmtblListPageTest {<br><br> private TestContext ctx;<br> <br> <br> @Binding<br> private EmtblDao dao;</div><div><br> private DataAccessor accessor;</div><div><br></div><div> public EmtblListPageTest() {<br> <br> }<br> <br> @Test<br> public void testDoOnceSearch() {<br> <br> // テスト対象の実行<br> Date date = null;<br> try {<br> date = DateFormat.getDateInstance().parse("2014/01/01");<br> } catch (ParseException e) <br> e.printStackTrace();<br> }</div><div><br> EmtblDto[] resultDto = dao.selectByIdKenmei("0001", "1", "0297", "000001", date);<br> <br> // 返値の検証<br> assertEquals("RESULT", 2, resultDto.length); </div><div><br> Emtbl[] resultList = dao.selectAll();<br> DataSet expected = ctx.getExpected();<br> assertEquals("OUTPUT", expected, resultList); ←ここでエラーが出ています<br></div><div><br></div><div> }</div><div>}</div><div><br></div><div><br></div><div data-signatureblock="true"><div><br></div><div><br></div></div>
</div>
</body>
</html>