How do I run setup and tear-down code once for all my tests?
Created Apr 30, 2002
Mike Clark Wrap the top level test suite in a subclass of TestSetup.
The following is a sample AllTests.suite() method:
public static Test suite() {
TestSuite suite = new TestSuite();
// Add your tests to the suite here
TestSetup wrapper = new TestSetup(suite) {
public void setUp() {
oneTimeSetUp();
}
public void tearDown() {
oneTimeTearDown();
}
};
return wrapper;
}