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 12. Unit-testing EJBs

This chapter covers

  • Unit-testing all types of EJBs: session beans, entity beans, and message-driven beans

  • Using mock objects, pure JUnit, and Cactus

  • Automating packaging, deployment, and container start/stop using Ant

 

“The time has come,” the Walrus said, “To talk of many things: Of shoes—and ships—and sealing-wax—Of cabbages—and kings—And why the sea is boiling hot—And whether pigs have wings.”

 
 --Lewis Carroll, Through the Looking Glass

Testing EJBs has a reputation of being a difficult task. One of the main reasons is that EJBs are components that run inside a container. Thus, you either need to abstract out the container services used by your code or perform in-container unit testing. In this chapter, we’ll demonstrate ...

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