[Seasar-user:6977] Re: S2JUnit4でExcelファイルの期待値を使用

加藤 潤一 [E-MAIL ADDRESS DELETED]
2007年 3月 30日 (金) 12:35:29 JST


$B2CF#$G$9!%(B

$B;d$b(BS2JUnit4$B$G(BS2Dao$B$N(BDao$B$N%F%9%H%3!<%I=q$$$F$$$^$9!%(B

$B%(%s%F%#%F%#$N%j%9%H$r8!>Z$7$?$$$s$G$9$h$M!)(B
$B;d$O!$(BassertEquals$B$G$O$J$/!$(BassertBeanEquals$B$r;H$C$F$$$^$9$,!$E*$r30$l$@$C$?$i$9$_$^$;$s!%(B

import static org.seasar.framework.unit.S2Assert.assertBeanEquals;

        public void testSelectAll() {
                List<UserInfo> result = this.userInfoDao.selectAll();
                assertBeanEquals(ctx.getExpected(), result);
        }

        public void testSelectById() {
                UserInfo result = this.userInfoDao.selectById("hogehoge");
                assertBeanEquals(ctx.getExpected(), result);
        }

> -----Original Message-----
> From: [E-MAIL ADDRESS DELETED]
> [mailto:[E-MAIL ADDRESS DELETED]] On Behalf Of
> [E-MAIL ADDRESS DELETED]
> Sent: Thursday, March 29, 2007 10:49 PM
> To: [E-MAIL ADDRESS DELETED]
> Subject: [Seasar-user:6968] S2JUnit4$B$G(BExcel$B%U%!%$%k$N4|BTCM$r;HMQ(B
>
> $B>>86$G$9!#(B
>
> $B!!BgJQ?=$7Lu$4$6$$$^$;$s$,!"(BS2JUnit4$B$K$F(BExcel$B%U%!%$%k$N4|BTCM(B
> $B$r;HMQ$7$?>l9g$K0J2<$N$h$&$JHf3S$O$I$N$h$&$K$9$l$P<B8=$G$-$k$+(B
> $B$465<(D:$1$J$$$G$7$g$&$+!#(B
>
> $B!!(BTestContext ctx;
>
>   Page$B%/%i%9(B.$B%G!<%?<hF@%a%=%C%I(B();
>   $B!!(B(Page$B%/%i%9$G(BS2Dao$B$+$i%G!<%?<hF@(B $B!&!&!&(B $B-!(B)
> $B!!!!(B($B$=$NCM$r(BList$BJQ?t$[E-MAIL ADDRESS DELETED](B $B!&!&!&(B $B-"(B)
>
> $B!!(BassertEquals($B-"$N(BList$B7?(B, ctx.getExpected);
>
> $B!!$N$h$&$J$3$H$r8!>Z$7$?$$$N$G$9$,!"$&$^$/$$$-$^$;$s!#(B
> $B!!-"$N(BEntity$B%/%i%9$H$NHf3S$G$"$l$[E-MAIL ADDRESS DELETED]>o$KF0:n$7!"-"$N(B
> $B!!Hf3S$r>iD9$K$J$j$^$9$,0J2<$N$h$&$K#19`L\C10L$GHf3S$9(B
> $B!!$l$P!"Hf3S$O$G$-$^$9$,!"0c$&$H;W$$$^$9!#(B
>
> $B!!(BassertEquals($B-"(B[i].getXxx(),
> ctx.getExpected().getTable("x").getRow[i].getValue(0).toString());
>
> $[E-MAIL ADDRESS DELETED]$JJ}K!$r$465<(D:$1$k$H9,$$$G$9!#59$7$/$*4j$$CW$7$^$9!#(B
>
> $B0J>e$G$9!#(B


Seasar-user メーリングリストの案内