Guideline: Developer Testing for J2EE Applications
This guideline describes some additional considerations that need to be taken into account when unit testing J2EE components.
Related Elements
Main Description

Setting Up the Test Environment

Ordinary Java classes can be compiled and tested without creating a J2EE Module. However, J2EE components, such as EJBs and servlets, rely on services provided by the container, and must be assembled and deployed to a container in order to be tested.

Thus, the implementer of J2EE components must assemble the components into J2EE Module(s) and possibly a J2EE Application, and then deploy those archives to a unit testing environment prior to unit testing.

For more information on assembling J2EE Modules, see Guideline: Assembling J2EE Modules.

For more information on assembling J2EE Applications, see Guideline: Assembling J2EE Applications.

For more information on deploying J2EE Applications, see Guideline: Deploying J2EE Modules and Applications.

General J2EE Testing Guidelines

In addition to testing the functionality provided by the source code, for EJBs, JSPs, and Servlets, the container itself provides functionality that needs to be tested, such as persistence, transactions, and security.