$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>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;final Class&lt;SimpleUserdetails&gt; entityType = SimpleUserdetails.class;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;final SimpleselectUserdetailspmb pmb = new SimpleselectUserdetailspmb();<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pmb.setUserid("test");<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;final List&lt;SimpleUserdetails&gt; resultList =&nbsp; userdetailsBhv.outsideSql().selectList("sql/userdetails/selectuserdetails.sql",pmb, entityType);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (resultList.size() &gt; 0){<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return true; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else{<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return false;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;}<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>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Class result = registerPage.userCheck();&nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; assertTrue(result);<br>
&nbsp;&nbsp;&nbsp; }<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&lt;SimpleUserdetails&gt; resultList =&nbsp; 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>
&nbsp;&nbsp;&nbsp; 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;">&nbsp;</div>
<p>&#32;

<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>