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 Murach's Java Servlets and JSP this week in the Servlets 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: 184
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: 888
    
    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: 184
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
 
 
subject: How to do a test on local EJB service
 
Similar Threads
Junit test EJB
EJB - Local interface
Problems with EJB Local and using servlets - null pointers
ejb3unit test, no business interface for class problem
EJB 3 and test-driven development