01: package test.junit;
02:
03: import junit.framework.TestCase;
04:
05: /**
06: * Base JUnit test case to verify TestNG handles
07: * TestCase hierarchies properly.
08: *
09: * @author mperham
10: */
11: public abstract class BaseTest extends TestCase {
12:
13: private static int setUpInvokeCount = 0;
14: private static int tearDownInvokeCount = 0;
15:
16: public BaseTest(String name) {
17: super (name);
18: }
19:
20: @Override
21: protected void setUp() throws Exception {
22: setUpInvokeCount++;
23: }
24:
25: @Override
26: protected void tearDown() throws Exception {
27: tearDownInvokeCount++;
28: }
29:
30: public abstract void testA();
31:
32: public abstract void testB();
33:
34: public static int getSetUpInvokeCount() {
35: return setUpInvokeCount;
36: }
37:
38: public static int getTearDownInvokeCount() {
39: return tearDownInvokeCount;
40: }
41:
42: }
|