O'Reilly logo

JUnit in Action by Ted Husted, Vincent Massol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. In-container testing with Cactus

This chapter covers

  • Drawbacks of mock objects when unit-testing components

  • Introducing testing inside the container with Cactus

  • How Cactus works

 

Good design at good times. Make it run, make it run right.

 
 --Kent Beck, Test Driven Development: By Example

Starting with this chapter, we’ll study how to unit-test J2EE components. Unit-testing components is more difficult than just testing plain Java classes. The components interact with their container, and the container services are available only when the container is running. JUnit is not designed to run inside a container like a J2EE component. So, how can we unit-test components?

This chapter examines one approach to unit-testing J2EE components: in-container ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required