Chapter 8. Troubleshooting JUnit

This chapter covers

  • Problems finding your tests
  • Problems executing your custom test suite and test setup
  • Problems executing your test after the first assertion fails
  • Problems reloading classes between tests
  • Problems reloading XML-related classes
  • Problems narrowing EJB references in your tests

Wouldn’t it be nice if everything worked exactly the way you expected it to work? Come to think of it, if that were so then you wouldn’t be reading this book—or maybe because you’re reading this book, the software you build will work exactly the way you expect. At least, that’s the idea.

This chapter is about how to handle those situations in which JUnit doesn’t do what you expect. Although JUnit is simple, it is a framework, ...

Get JUnit Recipes: Practical Methods for Programmer Testing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.