[EMAIL PROTECTED] wrote:
The problem with this approach, which I also found at http://marc.theaimsgroup.com/?l=cactus-user&m=100879309609213&w=2 and tried is, the MDB calls a session ejb and this might again call another MDB (There is a complex workflow design behind that). So it may be possible to make a call to the first MDB's onMessage(), but this will return back soon and the testXXX() methods might fail like the previous scenario.
Presumably the MDB retrieves the Session EJB from JNDI. The standard solution to this is this:
1. Move the code that retrieves the Session EJB to the top of the onMessage() method.
2. Apply Extract Method to the rest of onMessage() so that the new method takes the Session EJB remote component interface as a parameter.
3. Test the newly extracted method directly without the container.
4. Verify your deployment descriptor to make sure that you deploy the Session EJB correctly.
See JUnit Recipes: Practical Programmer Testing Methods for more. :) -- J. B. Rainsberger, Diaspar Software Services http://www.diasparsoftware.com :: +1 416 791-8603 Let's write software that people understand
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
