<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20315">
<style type="text/css"><!--html { font-family: "Color Emoji", "Meiryo", "Calibri", "Segoe UI", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; }--></style><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><br></div><div>ご指摘通り、作業を行ってみた結果</div><div>グリーンバーになりました。</div><div>ありがとうございました。</div><div><br></div><div>阿形<br></div><div data-signatureblock="true"><div><br></div><div><br></div><div><br></div></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Meiryo', 'Calibri', 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Meiryo", "Calibri", "Segoe UI", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;'><b>差出人:</b>&nbsp;<a href="mailto:toshihiro.nakamura@gmail.com" target="_parent">Toshihiro Nakamura</a><br><b>送信日時:</b>&nbsp;‎2014‎年‎1‎月‎30‎日 ‎木曜日 ‎23‎:‎44<br><b>宛先:</b>&nbsp;<a href="mailto:seasar-user@ml.seasar.org" target="_parent">seasar-user@ml.seasar.org</a></font></div></div><div><br></div><div dir=""><div id="readingPaneBodyContent">中村です。<br><br>使用しているassertEqualsメソッドが間違っているようです。<br>org.seasar.framework.unit.S2Assertクラスの次のようなメソッドをお使いください。<br><br>&nbsp;public static void assertEquals(DataSet expected, Object actual)<br>&nbsp;public static void assertEquals(String message, DataSet expected,<br>Object actual)<br><br>2014-01-30&nbsp; &lt;shigeaga@gmail.com&gt;:<br>&gt; いつも大変お世話になっております。<br>&gt; 阿形と申します。<br>&gt;<br>&gt; 現在、S2Unit4を使用してテストを行っております。<br>&gt; ですが中々テストが通らず苦心しています。<br>&gt; お手数おかけしますが、見落としている箇所<br>&gt; 見直したほうが良い箇所がありましたら教えて<br>&gt; いただきたく、よろしくお願い致します。<br>&gt;<br>&gt; トレースのコピー<br>&gt;<br>&gt; java.lang.AssertionError: OUTPUT expected:&lt;Expected:HOZENNO, BUMONCODE,<br>&gt; SETSUBICODE, HASSEINICHIJI, SYUFUKUBI, SYAINCODE<br>&gt; {26, 0001, 000001, 14-01-10, 14-01-10, 0297}<br>&gt; {28, 0001, 000003, 14-01-14, 14-01-14, 0297}<br>&gt; {29, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {36, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>&gt; {19, 0001, 000001, 14-01-02, 14-01-02, 0295}<br>&gt; {33, 0001, 000001, 14-01-15, 14-01-15, 0297}<br>&gt; {38, 0001, 000001, 14-01-24, 14-01-24, 0297}<br>&gt; {31, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>&gt; {32, 0001, 000001, 14-01-15, 14-01-15, 0297}<br>&gt; {20, 0002, 000001, 14-01-02, 14-01-02, 0296}<br>&gt; {21, 0001, 000001, 14-01-06, 14-01-06, 0297}<br>&gt; {22, 0001, 000001, 14-01-07, 14-01-07, 0295}<br>&gt; {23, 0001, 000001, 14-01-06, 14-01-06, 0297}<br>&gt; {24, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {25, 0001, 000001, 14-01-10, 14-01-10, 0297}<br>&gt; {27, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {30, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {34, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {35, 0001, 000003, 14-01-15, 14-01-15, 0297}<br>&gt; {37, 0001, 000001, 14-01-14, 14-01-14, 0297}<br>&gt; {39, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>&gt; {40, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>&gt; {41, 0001, 000001, 14-01-20, 14-01-20, 0297}<br>&gt; {18, 0001, 000001, 14-01-02, 14-01-02, 0295}<br>&gt;&gt; but was:&lt;[Lequipment.system.entity.Emtbl;@25592bea&gt;<br>&gt;&nbsp; at org.junit.Assert.fail(Assert.java:74)<br>&gt;&nbsp; at org.junit.Assert.failNotEquals(Assert.java:448)<br>&gt;&nbsp; at org.junit.Assert.assertEquals(Assert.java:102)<br>&gt;&nbsp; at<br>&gt; equipment.system.web.emtbl.EmtblListPageTest.testDoOnceSearch(EmtblListPageTest.java:72)<br>&gt;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&gt;&nbsp; at<br>&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>&gt;&nbsp; at<br>&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>&gt;&nbsp; at java.lang.reflect.Method.invoke(Method.java:601)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)<br>&gt;&nbsp; at<br>&gt; org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)<br>&gt;&nbsp; at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br>&gt;&nbsp; at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br>&gt;<br>&gt; テストコード<br>&gt;<br>&gt; package equipment.system.web.emtbl;<br>&gt;<br>&gt; import static org.junit.Assert.*;<br>&gt;<br>&gt; import java.text.DateFormat;<br>&gt; import java.text.ParseException;<br>&gt; import java.util.Date;<br>&gt;<br>&gt; import org.junit.Before;<br>&gt; import org.junit.Test;<br>&gt; import org.junit.runner.RunWith;<br>&gt; import org.seasar.extension.dataset.DataSet;<br>&gt; import org.seasar.framework.container.annotation.tiger.Binding;<br>&gt; import org.seasar.framework.unit.DataAccessor;<br>&gt; import org.seasar.framework.unit.Seasar2;<br>&gt; import org.seasar.framework.unit.TestContext;<br>&gt;<br>&gt; import equipment.system.dao.EmtblDao;<br>&gt; import equipment.system.dto.EmtblDto;<br>&gt; import equipment.system.entity.Emtbl;<br>&gt;<br>&gt; @RunWith(Seasar2.class)<br>&gt; public class EmtblListPageTest {<br>&gt;<br>&gt;&nbsp; private TestContext&nbsp; ctx;<br>&gt;<br>&gt;<br>&gt;&nbsp; @Binding<br>&gt;&nbsp; private EmtblDao&nbsp; dao;<br>&gt;<br>&gt;&nbsp; private DataAccessor accessor;<br>&gt;<br>&gt;&nbsp; public EmtblListPageTest() {<br>&gt;<br>&gt;&nbsp; }<br>&gt;<br>&gt;&nbsp; @Test<br>&gt;&nbsp; public void testDoOnceSearch() {<br>&gt;<br>&gt;&nbsp;&nbsp; // テスト対象の実行<br>&gt;&nbsp;&nbsp; Date date = null;<br>&gt;&nbsp;&nbsp; try {<br>&gt;&nbsp;&nbsp;&nbsp; date = DateFormat.getDateInstance().parse("2014/01/01");<br>&gt;&nbsp;&nbsp; } catch (ParseException e)<br>&gt;&nbsp;&nbsp;&nbsp; e.printStackTrace();<br>&gt;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp; EmtblDto[] resultDto = dao.selectByIdKenmei("0001", "1", "0297", "000001",<br>&gt; date);<br>&gt;<br>&gt;&nbsp;&nbsp; // 返値の検証<br>&gt;&nbsp;&nbsp; assertEquals("RESULT", 2,&nbsp; resultDto.length);<br>&gt;<br>&gt;&nbsp;&nbsp; Emtbl[] resultList = dao.selectAll();<br>&gt;&nbsp;&nbsp; DataSet expected = ctx.getExpected();<br>&gt;&nbsp;&nbsp; assertEquals("OUTPUT", expected, resultList);&nbsp; ←ここでエラーが出ています<br>&gt;<br>&gt;&nbsp; }<br>&gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Seasar-user mailing list<br>&gt; Seasar-user@ml.seasar.org<br>&gt; https://ml.seasar.org/mailman/listinfo/seasar-user<br>&gt;<br><br><br><br>-- <br>Toshihiro Nakamura<br>_______________________________________________<br>Seasar-user mailing list<br>Seasar-user@ml.seasar.org<br>https://ml.seasar.org/mailman/listinfo/seasar-user<br></div></div></div>
</body>
</html>