This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Testing and the fly likes JUnit integration with EJB and Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUnit integration with EJB and Spring" Watch "JUnit integration with EJB and Spring" New topic

JUnit integration with EJB and Spring

Arun Vasu

Joined: Oct 05, 2010
Posts: 24


I am new to JUnit and need to write JUnit test cases involving Spring and EJB in one functionality.

Please read below the exact scenario.

1. Fetching a list of employees using Spring jdbcTemplate.
2. Disable these employees using an EJB service.

Currently I am using org.springframework.test.AbstractDependencyInjectionSpringContextTests for creating unit test for employee fetching using Spring.
After this I need to call the EJB service for this employee list to disable them.

Please help me whether I can integrate these Sring and EJB in same JUnit test case or I need to write separate test cases ?

Your help is greatly appreciated
Rob Spoor

Joined: Oct 27, 2005
Posts: 19697

Moving to our test forum.

How To Ask Questions How To Answer Questions
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 30580

Yes, you can use the same integration test case if the EJB is a remote call.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
GeeCON Prague 2014
subject: JUnit integration with EJB and Spring