Let’s face it, JUnit has become the de facto standard for Java technology testing. Sure there are other powerful test frameworks (TestNG!), but they’ve never enjoyed the broad acceptance JUnit has, especially since the ingenious new version was released last year.
Andrew Glover recently published a tutorial: Jump into JUnit 4. A supplement to his popular “In pursuit of code quality” series, the tutorial published by IBM developerWorks guides you step-by-step through the fundamental concepts of JUnit 4, with emphasis on the new Java 5 annotations.
At the conclusion of this one-hour tutorial, you will understand the major changes to JUnit 4, as well as being familiar with features such as exception testing, parametric testing, and the new flexible fixture model. Last but not least, you will know how to do the following:
* Declare a test
* Use annotations to logically group tests prior to running them
* Run tests in Eclipse 3.2 or Ant, as well as from the command line
Check out the tutorial here and don’t miss the accompanying discussion forum for assistance with code metrics, test frameworks, and the creation of quality-focused code.
