18.1. What's Covered Here?This chapter demonstrates unit testing using both JUnit 3.8.1 and Cactus 1.7, the latest releases of both of these tools at the time of this writing. JUnit is a generic Java unit testing framework that can be used in any Java environment. You can download this tool from http://www.junit.org. We've written and executed the unit tests demonstrated in this chapter using a JDK 1.4.2 environment. Cactus is a JUnit extension that allows you to write tests that execute inside a J2EE container. The Cactus framework supports unit testing of various J2EE components, like servlets and EJBs, and other server-side J2EE code, like JSP tags and servlet filters, that depend on a server-side container environment in order to function. You can download Cactus from http://jakarta.apache.org/cactus. The Cactus test examples in this chapter were run in JBoss 4.0 and WebLogic 9.0 server environments. 18.1.1. Other Tools to ConsiderWe chose to cover JUnit and Cactus in this tutorial because, as with the other tools we've chosen, these unit testing tools are in wide use and are a good place to start for your testing needs. Of course, other tools that you can use to supplement or replace the functionality provided by JUnit and Cactus are available. Some of these include:
|