Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jUnit 4.0 test entitymanager = null

843830Jan 31 2009
Hello.
I'm beginning to learn about EJB 3.0.
I've started to write a small (rather "small") program in ejb 3.0, and everything is ok, but I'm trying to add some junit test to it, and I have this problem:

I've created test case for my class CalendarManager (session bean to do something with my entities) - with three methods - addEvent, removeEvent, and updateEvent;

when I'm trying to run the test from eclipse method calnderadManager.addEvent(e) throws nullpointer exception.
The thing is that inside there is an entitymanager which is offcourse null.

Now it's null beacause test isn't running on jboss - i know that.

Is there any solution to this? How can I run a simple test case of my sesion bean from eclipse being connected to jboss context at the time?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2009
Added on Jan 31 2009
0 comments
386 views