Chapter 13. Testing J2EE applications
This chapter covers
- Testing web application page flow, including Struts
- Testing your site for broken links
- Testing web and EJB resource security
- Testing container-managed transactions
As you read this book it should become clear that we advocate testing an application by testing its components thoroughly, and then integrating those components as simply as possible. Specifically, “integration” for us is little more than choosing which implementations of various interfaces to use, and then creating an application entry point object with references to those implementations. Which logging strategy do we use? How about Log4J! We know that our components work with any implementation of the logging strategy interface. What kind of model? A JDBC-based one, although our Controller really only knows about our Model interface, so an in-memory implementation, or one based on Prevayler (www.prevayler.org) will do. To us, this is integration. As a result, we tend not to emphasize End-to-End Testing for correctness, but rather to give us confidence that we have built the features we needed to build. Object Tests tell you whether you built the thing right; whereas End-to-End Tests help you decide whether you built the right thing.