jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Franz Roth" <franzr...@gmx.de>
Subject Re: I got NullPointer Exception when I test my ejb (EJB3.0 version) using Junit with Cactus
Date Thu, 07 Dec 2006 18:25:40 GMT
hi,

in your sample-code the sampleFacede is never instantiated; so it's null  
while you're trying to find somthing with it?!



> HI,
>
>
>  My code is like this.
>
>
> public class SampleFacadeTest extends ServletTestCase {
>
>
>     @EJB
>
>     SampleFacadeLocal sampleFacade;
>
>
>     public void setUp() {
>
>
>     }
>
>
>     public static Test suite()
>
>     {
>
>         return new TestSuite(SampleFacadeTest.class);
>
>     }
>
>     */
>
>
>     public void testFind() throws Exception{
>
>         String firsName =  "Rick";
>
>         String testName = sampleFacade.find(112233).getFirstName();
>
>         assertEquals(firsName , testName);
>
>     }
>
>
>
>
> }
>
>
> The sampleFacade variable got null pointer exception at line
>
>
> String testName = sampleFacade.find(112233).getFirstName();
>
>
> EJB3.0 is new thing. I wish I could get answer from here.
>
>
> Thanks.
>

Mime
View raw message