I am very happy to announce the availability of
TestNG 2.0!

TestNG is a testing framework that fixes most of JUnit’s deficiencies and
innovates in a number of ways:  use of annotations, configurable dynamic
invocation (no need to recompile), test method groups, dependent methods,
external parameters, etc…

There is only one new feature in this release, but it’s quite a big one: 
JDK 1.4 support.

Thanks to the restless efforts of Alexander "Mindstorm" Popescu, TestNG can
now be run with JDK 1.4, using the familiar JavaDoc annotations.

Here is an example:

import com.beust.testng.annotations.*;
public class SimpleTest {
/**
* @testng.configuration beforeTestClass = "true"
*/
public void setUp() {
// code that will be invoked when this test is instantiated
}
/**
* @testng.test groups = "functest"
*/
public void testItWorks() {
// your test code
}
}

Using TestNG with JDK 1.4 is straightforward and very similar to how you
invoke it with JDK 1.5, which will make future migrations easy:

  • Include the TestNG jdk14 jar file in your classpath
  • Specify a srcdir attribute in the testng ant task, so TestNG can
    locate your annotated sources

And that’s all!  TestNG works exactly the same regardless of whether you
use JavaDoc or JDK 1.5 annotations, and all the regression tests have been
updated to make sure both versions cover the exact same features.  For the
record, we are using the excellent QDox
to parse annotations and Doug Lea’s original concurrent utilities to implement
parallel test runs.