> 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 | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
