01: package test.sample;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: /**
07: * @author Cedric Beust, Apr 30, 2004
08: */
09: public class BaseSampleInheritance {
10:
11: protected List m_configurations = new ArrayList();
12:
13: protected void addConfiguration(String c) {
14: m_configurations.add(c);
15: }
16:
17: protected boolean m_invokedBaseMethod = false;
18:
19: /**
20: * @testng.test groups="inheritedTestMethod"
21: */
22: public void baseMethod() {
23: m_invokedBaseMethod = true;
24: }
25:
26: protected boolean m_invokedBaseConfiguration = false;
27:
28: /**
29: * @testng.before-class
30: */
31: public void baseConfiguration() {
32: m_invokedBaseConfiguration = true;
33: }
34:
35: /**
36: * @testng.before-class
37: * dependsOnGroups="configuration0"
38: * groups="configuration1"
39: */
40: public void configuration1() {
41: // System.out.println("CONFIGURATION 1");
42: addConfiguration("configuration1");
43: }
44:
45: /**
46: * @testng.test dependsOnGroups="inheritedTestMethod"
47: */
48: public void testBooleans() {
49: assert m_invokedBaseMethod : "Didn't invoke test method in base class";
50: assert m_invokedBaseConfiguration : "Didn't invoke configuration method in base class";
51: }
52:
53: }
|