01: package test.junit.testsetup;
02:
03: import junit.extensions.TestSetup;
04: import junit.framework.TestSuite;
05:
06: public class TestSuiteContainerWrapper extends TestSetup {
07: private static Data INSTANCE = null;
08: private static TestSuite _test = null;
09: private static Class dataImpl = null;
10:
11: public TestSuiteContainerWrapper(TestSuite testSuite, Class dataImpl) {
12: super (testSuite);
13: _test = testSuite;
14: TestSuiteContainerWrapper.dataImpl = dataImpl;
15: }
16:
17: public static Data getData() {
18: return INSTANCE;
19: }
20:
21: @Override
22: protected void setUp() throws Exception {
23: System.out.println("setup");
24: INSTANCE = (Data) dataImpl.newInstance();
25: }
26:
27: @Override
28: protected void tearDown() throws Exception {
29: System.out.println("teardown");
30:
31: INSTANCE = null;
32:
33: System.out.println(_test.countTestCases()
34: + " test cases defined by \"" + _test.getName()
35: + "\" were executed.");
36: }
37: }
|