1

I work on a maven project that needs to be jdk1.4 compliant. Our testng classes use the pseudo-javadoc comments to define tests.

/**
 * @testng.test
 */

In Netbeans, the right-click menu works fine to run tests. In Eclipse, my collegues tell me it does not work and the test class is not found. So I've been trying to add a main() to the test classes, using something along the lines of

TestNG testng = new TestNG();
testng.setTestClasses( new Class[]{MyTestClass.class} );
testng.run();

But when I do, I get the following result:

Command line suite
Total tests run: 0, Failures: 0, Skips: 0

So, basically, tests are not found, which does not surprise me, as something needs to parse the javadoc and I don't see how it could happen here. Has anyone had a similar problem? How did you get around it so that individual classes can be tested easily in Eclipse?

  • Have you tried the testng eclipse plugin: http://testng.org/doc/eclipse.html ? To quote: "Once you have selected one of these launches, you can also choose ... whether TestNG should run in 1.4 or 1.5 mode." – richvdh Mar 08 '12 at 16:33

1 Answers1

1

TestNG stopped supporting JDK 1.4 a while ago.

Cedric Beust
  • 15,480
  • 2
  • 55
  • 55