JUnitEE
JUnit is a great tool for unit testing Java applications but it is little difficult to apply it and test the flow from a web application perspective. Particularly say you have unit tests for your DAO you will have to use the JDBC driver connection class to connect to the database and cannot test through JNDI as it requires a server environment. Try JUnitEE. From the site,
JUnitEE provides a TestRunner which outputs HTML and a servlet which can be used as an entry point to your test cases. Building your test harness as a standard J2EE web application means:
- Your tests are packaged conveniently into a .war file which can easily be moved between servers; you can leave the .war file in the main .ear file and simply avoid enabling the test web application on the production server.
- Your test classes will be dynamically reloaded by the app server (assuming your server supports this).
- Your test cases look just like your production code, and can use the same beans (or whatever) you use as a facade for your EJBs.












Alex Lu Said,
March 10, 2007 @ 12:38 pm
Hi Ramesh,
This is Alex working as a J2EE pgmmer .I found a glitch in this article . I am jumping through hoops trying to get all of this straightened out on theJ2EE side when this should not have happened to begin with.I will verify it and let you know.Any way i appreciate your effort to promote Java.
Keep in touch
Alex .J .Lu
Ramesh Said,
March 10, 2007 @ 12:54 pm
Hi Alex,
Thanks for letting me know. Please let me know what it is and I will be glad to incorporate the change after going through it.
Ramesh