Cactus Ejb

The purpose of this page is a design discussion for proposed extensions to the Cactus framework to allow easier unit testing of Enterprise Java Beans. (Initiated by MikeDavis.) Please add your comments and suggestions.


EJB Test Redirector

In Cactus there are currently redirectors for Servlets and Jsp's. I have now created an Ejb redirector. (I haven't posted the code yet). This redirector acts as a proxy to the EJB container for testcases being run on the client. The client connects to the redirector, which is an EJB, by looking it up through JNDI and then narrowing it. It then requests that the JUnit test methods be run on the server. The redirector uses reflection to instantiate and execute the test methods. Since the tests are now executing from within the EJB container they are able to more easily access the EJb's they need to test, they also have access to container's resources.Good...

Questions

- Is this something that could be useful?

- Can anyone think of any problems we might have with this design, namely problems arising from connecting to the EJB as a RMI client?

- An idea was thrown out that this would allow testing of EJB methods that are not exposed through a home or remote interface by having the ability to call the EJB as a standard Java class. Is this useful? thoughts?

- There was some thoughts about the need to override the Session and Entity context that are created in order to test the EJB, this would be needed if the EJB was called as a standard Java class. Any issues with this?

Question from Reddy? Give Some idea about testing ejb in websphere platform using cactus Tool.

-- MikeDavis

See also CactusStack.

I think what is more important(but maybe is solved from the JSR for the EJB 3.1 specification) is the easy testing(testing EJB 3.0 can't be viewed as unit tests since there is no reason to test an EJB in isolation mode) of EJB 3.0 I have tried various tools(JBoss Embedded, OpenEJB ...and so on) but i end up hitting my head in various walls.No i am testing cactus.The drawback i see is that we must use cargo plugin for maven in order to start a full functional container.If we use jboss then we have huge lag time because of the boot/shutdown time of the appserver.Any suggestions about the best tool for that reason and with that i mean a tool with DOCUMENTATION!!!! --Nick Mpallas


EditText of this page (last edited May 29, 2009) or FindPage with title or text search