In this article, N. Alex Rupp covers advanced EJB testing practices, goes over some pitfalls and how to avoid them, identifies OpenEJB's glass jaw, and outlines a future course for the EJB testing community. Some of the topics covered include configuring multiple EJB containers, isolating component subsets, mock object techniques with real components, and more.
- Posted by: Nate Borg
- Posted on: July 06 2004 12:09 EDT
Read Container Driven Testing: Advanced EJB Testing with OpenEJB - Part 3: Advanced Testing Techniques
- CDT for EJB3.0? by kirupakaran seshachalam on July 07 2004 03:57 EDT
- OpenEJB container driven testing plugin 404 by Archimedes Trajano on July 12 2004 01:30 EDT
Will Container Driven Testing be of any use in EJB3.0? I think in EJB3.0 I can test my ejb just like another java object.
Will Container Driven Testing be of any use in EJB3.0? I think in EJB3.0 I can test my ejb just like another java object.-KirupaAnything that references the EJB 3 API including EntityManager, SessionContext, UserTransaction and others will still need container support to run or test. Throw in attributes with deployment descriptors overriding those attributes and you have a little too much to mock up.
As CDT tools like JunitEE, Cactus, and OpenEJB will always exist and several people will have applications that mix EJB 2 with EJB 3, the need and applicability of CDT tools won't go away.
Yes, you are right, the out of container test approach leads to short build-test-cycles, because no container deployment is necessary anymore. I used Ejb3Unit, to automate our entity and session bean testing outside the container for the EJB 3.0 specification. Ejb3Unit is a JUnit extention and can execute automated standalone Junit tests for all EJB 3.0 conform JEE projects. You will find it here: http://ejb3unit.sourceforge.net/
the link to OpenEJB container driven testing plugin [ http://www.openejb.org/cdt yields ] a 404
Yeah, sorry about that. We'll have to get some status up on that page. This isn't ready for public consumption quite yet. We're working on it and we'll keep you posted ;)