$B$$$D$b$*@$OC$K$J$j$^$9!#(B<br>
<br>
$B%F%9%H$r9T$&:]2r>C$7Fq$$LdBj$,$"$C$FEj9F$7$F$*$j$^$9!#(B<br>
DBFlute$B$r;H$C$F2<5-$N%m%8%C%/$r9T$&%a%=%C%I$r(BJUnit$B$G%F%9%H$7$F(B<br>
$B$*$j$^$9$,!#!#(B<br>
<br>
<br>
public boolean userCheck(){<br>
final Class<SimpleUserdetails> entityType = SimpleUserdetails.class;<br>
final SimpleselectUserdetailspmb pmb = new SimpleselectUserdetailspmb();<br>
<br>
pmb.setUserid("test");<br>
<br>
final List<SimpleUserdetails> resultList = userdetailsBhv.outsideSql().selectList("sql/userdetails/selectuserdetails.sql",pmb, entityType);<br>
<br>
if (resultList.size() > 0){<br>
return true; <br>
}<br>
else{<br>
return false;<br>
}<br>
<br>
}<br>
<br>
----<br>
selectuserdetails.sql$B$O2<5-$NMM$K$J$C$F$$$^$9!#(B<br>
<br>
-- #SimpleUserdetails#<br>
-- !SimpleselectUserdetailspmb!<br>
-- !!String userid!!<br>
<br>
select * from userdetails <br>
/*BEGIN*/ where<br>
/*IF pmb.userid!= null*/userid=/*pmb.userid*/'ag01'/*END*/<br>
/*END*/<br>
<br>
---<br>
$B%F%9%H$N0Y$K2<5-$NMM$J%a%=%C%I$r%F%9%H%/%i%9$G;H$C$F$$$^$9!#(B<br>
$B!w(Btest<br>
public void testUserCheck() {<br>
<br>
Class result = registerPage.userCheck(); <br>
<br>
assertTrue(result);<br>
}<br>
<br>
$B%F%9%H%/%i%9$O(BS2TestCase$B$r7Q>5$7$F$$$^$9!#(B<br>
$BIaDL$N;~$O$A$c$s$HF0$$$F$k%U%!%$%k$?$A$G$9$,!"(B<br>
$B%F%9%H$9$k;~$O(B<br>
final List<SimpleUserdetails> resultList = userdetailsBhv.outsideSql().selectList("sql/userdetails/selectuserdetails.sql",pmb, entityType);<br>
<br>
$BItJ,$G(BnullPointException$B$,5/$-$^$9!#(B<br>
System.out.println();$B$G(Bpmb$B$H(BentityType$B$r=PNO$7$F$_$?$i(B<br>
$BCM$OF~$C$F$$$^$9!#!JMW$9$k$K(Bpmb$B$H(BentityType$B$O(Bnull$B$G$O$J$$!#!K(B<br>
$B$I$N$G(Bnull$BCM$,$"$C$F(B<br>
java.lang.NullPointerException<br>
at sampleproject.web.login.RegisterPage.usercheck(RegisterPage.java:77)<br>
<br>
$B$H(BJunit$B%&%#%s%I%&$K=P$k$+J,$+$j$^$;$s!#!#(B<br>
<br>
DBflute$B$r;H$&;~$OJL$K%F%9%HJ}$,$"$j$^$9$+!#(B<br>
DBflute$B$H$O4X78$J$$;v$G$9$+!#(B<br>
<br>
$B$*Ez$($*4j$$$$$?$7$^$9!#!#(B<br>
<br>
<div style="line-height: 0; width: 0; height: 5px; clear: both;"> </div>
<p> 
<hr size=1><a href=http://pr.mail.yahoo.co.jp/ganbare-nippon/ target="new">GANBARE! NIPPON! Win your ticket to Olympic Games 2008.</a><br>