File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes How to do a test on local EJB service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "How to do a test on local EJB service" Watch "How to do a test on local EJB service" New topic
Author

How to do a test on local EJB service

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 174
Good day,

I'm seeking for the advice of how we can test the local EJB service which hosted in jBOSS by Junit from eclipse IDE?

Thanks
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 761
    
    9
You can use mocking libraries like mockito to mock out the injection or (better) use arquillian to test the unit in an embeddable container.
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 174
Hi E Armitage,

for the case of mockito, is it using injectMocks? is it required Contecx Lookup in start up?

http://docs.mockito.googlecode.com/hg/latest/org/mockito/InjectMocks.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to do a test on local EJB service
 
Similar Threads
ejb3unit test, no business interface for class problem
EJB 3 and test-driven development
Problems with EJB Local and using servlets - null pointers
Junit test EJB
EJB - Local interface