O'Reilly logo

JUnit in Action, Second Edition by Gary Gregory, Vincent Massol, Felipe Leme, Petar Tahchiev

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

The secret of success is sincerity. Once you can fake that you’ve got it made.

Jean Giraudoux

This chapter covers

  • The drawbacks of mock objects
  • In-container testing
  • Comparing stubs, mock objects, and in-container testing

This chapter examines one approach to unit testing components in an application container: in-container unit testing, or integration unit testing. We discuss in-container testing pros and cons and show what can be achieved using the mock objects approach introduced in chapter 7, where mock objects fall short, and how in-container testing enables you to write integration unit tests. Finally, we compare the stubs, mock objects, and in-container approaches we’ve already covered in this second ...

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