<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> <a href="mailto:toshihiro.nakamura@gmail.com" target="_parent">Toshihiro Nakamura</a><br><b>送信日時:</b> 2014年1月30日 木曜日 23:44<br><b>宛先:</b> <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> public static void assertEquals(DataSet expected, Object actual)<br> public static void assertEquals(String message, DataSet expected,<br>Object actual)<br><br>2014-01-30 <shigeaga@gmail.com>:<br>> いつも大変お世話になっております。<br>> 阿形と申します。<br>><br>> 現在、S2Unit4を使用してテストを行っております。<br>> ですが中々テストが通らず苦心しています。<br>> お手数おかけしますが、見落としている箇所<br>> 見直したほうが良い箇所がありましたら教えて<br>> いただきたく、よろしくお願い致します。<br>><br>> トレースのコピー<br>><br>> java.lang.AssertionError: OUTPUT expected:<Expected:HOZENNO, BUMONCODE,<br>> 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<br>> equipment.system.web.emtbl.EmtblListPageTest.testDoOnceSearch(EmtblListPageTest.java:72)<br>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>> at<br>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>> at<br>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>> at java.lang.reflect.Method.invoke(Method.java:601)<br>> at<br>> org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)<br>> at<br>> org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)<br>> at<br>> org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)<br>> at<br>> org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)<br>> at<br>> org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)<br>> at<br>> org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)<br>> at<br>> org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)<br>> at<br>> org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)<br>> at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)<br>> at<br>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)<br>> at<br>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>> at<br>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br>> at<br>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br>> at<br>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br>> at<br>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br>><br>> テストコード<br>><br>> package equipment.system.web.emtbl;<br>><br>> import static org.junit.Assert.*;<br>><br>> import java.text.DateFormat;<br>> import java.text.ParseException;<br>> import java.util.Date;<br>><br>> 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;<br>><br>> import equipment.system.dao.EmtblDao;<br>> import equipment.system.dto.EmtblDto;<br>> import equipment.system.entity.Emtbl;<br>><br>> @RunWith(Seasar2.class)<br>> public class EmtblListPageTest {<br>><br>> private TestContext ctx;<br>><br>><br>> @Binding<br>> private EmtblDao dao;<br>><br>> private DataAccessor accessor;<br>><br>> 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>> }<br>><br>> EmtblDto[] resultDto = dao.selectByIdKenmei("0001", "1", "0297", "000001",<br>> date);<br>><br>> // 返値の検証<br>> assertEquals("RESULT", 2, resultDto.length);<br>><br>> Emtbl[] resultList = dao.selectAll();<br>> DataSet expected = ctx.getExpected();<br>> assertEquals("OUTPUT", expected, resultList); ←ここでエラーが出ています<br>><br>> }<br>> }<br>><br>><br>><br>><br>><br>> _______________________________________________<br>> Seasar-user mailing list<br>> Seasar-user@ml.seasar.org<br>> https://ml.seasar.org/mailman/listinfo/seasar-user<br>><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>