I'm trying to upgrade suiterunner from 1.0beta6 to 1.0beta7 to take advantage of context passing, and having a problem making it work with my existing junit TestCase classes. There doesn't seem to be a similar problem mentionned in the forum, so it may be my setup rather than a bug, but I don't see where - perhaps someone could tell me. My unit tests all extend junit TestCase. In each package, there is one TestCase that runs the other test classes in the package, so calling the top 'package test case' can run all the test classes in the source code. They are all run with suiterunner by means of an ant target (first a perl script is invoked to generate the recipe file, then suite runner is called with the java task). So far, so good. I changed to beta7, and changed one 'package test case' to extend org.suiterunner.suite, to take advantage of context passing. If I run the tests as before, with a junit TestCase at the top, all the classes are called but the setUpSuite method is never called, probably because the junit method 'addTest' loses the suite's identity as an artima Suite. However, if I run the Suite subclass as the top, it calls its own test methods but not the test methods in the junit TestCase in its suite. Can I just code this differently, or do I have to change all my classes to subclass Suite in order to use context passing in any of them?
In pseudocode, when SuiteRunner runs A, B.testB is not called. <pre> public class A extends Suite { public static Test suite() { TestSuite suite = new TestSuite("A"); suite.addTest(B.suite()); return suite; }
public void testA () { System.out.println("testA"); } }
public class B extends TestCase {
public B ("String name") { super (name); }
public static Test suite() { TestSuite suite = new TestSuite("B"); suite.addTest(B.suite()); return suite; }
public void testB () { System.out.println("testB"); } } </pre> thanks.