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

Mistakes are the portals of discovery.

James Joyce

This chapter covers

  • Using the core JUnit classes
  • Understanding JUnit mechanisms
  • Understanding the JUnit lifecycle

In chapter 1, we decided that we need a reliable and repeatable way to test our program. Our solution is to write or reuse a framework to drive test code that exercises our program’s API. As our program grows with new classes and new methods to existing classes, we need to grow our test code as well. Experience has taught us that sometimes classes interact in unexpected ways; we need to make sure that we can run all of our tests at any time, no matter what code changes took place. The question becomes, how do we run multiple test classes? And ...

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