Search code examples
javajunit3

Junit 3, start testing from a java method


I'm need to use JUnit 3, I know in JUnit 4 there is a method in the API to start the JUnit tests from a normal method in Java (Result r = org.junit.runner.JUnitCore.runClasses(MyTestClass.class)). But how can I do this in JUnit 3 and getting the results of that?

edit: I'm now doing it with this: TestRunner.run(MyTestClass.class); But then I don't get any results..


Solution

  • I think this should work: http://pub.admc.com/howtos/junit3x/junit3x.html#using_runners-chapt