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

Appendix A. Differences between JUnit 3 and JUnit 4

This appendix covers

  • Changes between version 3.x and 4.x of JUnit
  • API changes
  • New features in JUnit 4.x

As you’ve probably seen, the new 4.x version of JUnit is a completely new framework. It’s more of a totally new project than a bug-fixing improvement of the old one. But it still deals with unit testing your Java code. That said, we will try to define all the differences between the latest version of JUnit and the 3.x version.

A.1. Global changes

This section discusses the changes in the requirements for using JUnit.

A.1.1. JDK required

JUnit 4 uses a lot from Java 5 annotations, generics, and static import features. Although the JUnit 3.x version can work with JDK 1.2+, this usage ...

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