haefeleuser wrote:

> I would like that the subclasses of CompanyTestCase only need to
> override the methods oneTimeSetUp() and oneTimeTearDown().
> But I didn't figure it out how to do it since its a mix of static and
> non static things.

You can do this by having CompanyTestSetup extend TestSetup, where
setUp() and tearDown() are instance-level methods.

As for applying CompanyTestSetup to your test cases, you can always
remove the duplication down to this:

public static Test suite() {
     return new CompanyTestSetup(new TestSuite(MyTestCase.class));
}

Extracting suites automatically from TestCase classes is the
responsibility of the test runner (or, better, a seperate "Test Suite
Builder"), and so if you want a test runner that works differently from
JUnit's built-in test runners, then build it and donating it back to the
community. I would personally like to see the responsibilities of
executing tests and building test suites be separated, but I don't seem
to get around to actually doing it.
--
J. B. (Joe) Rainsberger
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Predictable, repeatable, quality delivery

Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5526708.6599542.3001176/D=groups/S=:HM/A=2372354/rand=140497668


Yahoo! Groups Links

Reply via email to