<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>

<style>.hmmessage P{margin:0px;padding:0px}body.hmmessage{FONT-SIZE: 10pt;FONT-FAMILY:Tahoma}</style>$B$*@$OC$K$J$j$^$9!#LZ8M$H?=$7$^$9!#(B<br><br>$BI=Bj$N7o$G<ALd$5$;$F$/$@$5$$!#(B<br>$B8=:_(B,Teeda+S2dao+db-flute$B$G(Bj-unit$B$rMxMQ$7$F%F%9%H$r9T$*$&$H9M$($F$*$j$^$9!#(B<br>$B$=$3$G<ALd$G$9$,!"(Btest$B%/%i%9$+$i(BTeeda$B$N(BPage$B%/%i%9>e$K$"$k(Bdbflute$B%/%i%9$N(B<br>$B%F%9%H$O$I$N$h$&$K9T$($P$h$$$N$+LB$C$F$$$^$9!#(B<br>$B%F%9%H%/%i%9$r:n@.$7$?>l9g!"(BBhv$B%W%m%Q%F%#$,(BDI$B$5$l$J$$0Y!"(B<br>$B0J2<$NMM$K%F%9%H%/%i%9$r:n@.$7$F!"(BS2ContainerFactory$B$+$i(BBhv$B%/%i%9$r<hF@$7$F(B<br>$B%F%9%HBP>]%/%i%9(BLogin$B$N%F%9%H$r9T$*$&$H$7$F$$$k$N$G$9$,!"(B<br>container.init();<br>$B$N$H$3$m$G!"%I%i%$%P$,8+$D$+$i$J$$$H$$$C$?$h$&$J%(%i!<$,=PNO$5$l$F$7$^$$$^$9!#(B<br><br>$B$A$J$_$K!"%F%9%H$NJ}K!$H$7$F$O0J2<$r1~MQ$$$?$7$^$7$?!#(B<br><br>https://ml.seasar.org/archives/seasar-user/2007-August/011996.html<br><br>$B0J2<$,%F%9%H%/%i%9$G$9!#(B<br><br>package login;<br><br>import org.seasar.extension.unit.S2TestCase;<br>import org.seasar.framework.container.S2Container;<br>import org.seasar.framework.container.factory.S2ContainerFactory;<br>import org.seasar.teeda.core.unit.TeedaTestCase;<br><br>import sampleproject.dbflute.exbhv.UsersBhv;<br>import sampleproject.web.login.LoginPage;<br><br>public class LoginPageTest extends TeedaTestCase{<br><br>&nbsp;&nbsp;&nbsp; private static final String S2PATH="dbflute.dicon";<br><br>&nbsp;&nbsp;&nbsp; public void testdoCheck() throws Exception{<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; S2Container container=S2ContainerFactory.create(S2PATH);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Container-&gt;.............."+container);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; container.init();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("hai");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; UsersBhv usersBhv=(UsersBhv)container.getComponent(UsersBhv.class);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //LoginBhv loginBhv=new LoginBhv();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //LoginPage page = new LoginPage();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final LoginPage action = new LoginPage();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; action.atxt = "sd";&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; action.pwd="sd"&nbsp;&nbsp;&nbsp; ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; action.usersBhv=usersBhv;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Class a = action.doCheck();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // action.Check();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // ## Assert ##&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println($B!I(BaaaPage$B!I(B;a.getClass().getName());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }finally{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; container.destroy();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>}<br><br>$B$3$A$iB&$GD4$Y$?$H$3$m$G$O!"L@3N$J2r7hJ}K!$,H/8+$G$-$^$;$s$G$7$?!#(B<br>$B$I$J$?$+$4B8CN$NJ}$,$$$i$C$7$c$$$^$7$?$iEz$($$$?$@$1$^$;$s$G$7$g$&$+!)(B<br>$B$h$m$7$/8f4j$$$$$?$7$^$9!#(B<br><br><br><br><br><br><br><br /><hr />$B:#OCBj$K$J$C$F$k=PMh;v$dM-L>?M$r%i%s%-%s%0$GKh=5H/I=!V(BMSN $B5$$K$J$k8@MU!W(B <a href='http://clk.atdmt.com/GBL/go/msnjpqjl0040000012gbl/direct/01/' target='_new'>http://keyword.jp.msn.com/default.aspx</a></body>
</html>