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 2. Exploring JUnit

This chapter covers

  • Using the core JUnit classes

  • Understanding the JUnit life cycle

 

Mistakes are the portals of discovery.

 
 --James Joyce

In chapter 1, we decided that we need an automatic testing program so that we can replicate our tests. As we add new classes, we often want to make changes to classes under test. Of course, experience has taught us that sometimes classes interact in unexpected ways. So, we’d really like to keep running all of our tests on all of our classes, whether they’ve been changed or not. But how can we run multiple test cases? And what do we use to run all these tests?

In this chapter, we will look at how JUnit provides the functionality to answer those questions. We will begin with an overview ...

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