01: package test.inheritance;
02:
03: import org.testng.annotations.AfterMethod;
04: import org.testng.annotations.BeforeMethod;
05: import org.testng.annotations.Test;
06:
07: /**
08: * Make sure that configuration inherited methods are invoked in the right
09: * order. The funny naming is to make sure that the class names do not
10: * play any role in the ordering of methods.
11: *
12: * Created on Sep 8, 2005
13: * @author cbeust
14: */
15: public class DChild_2 extends Child_1 {
16:
17: @BeforeMethod
18: public void initDialog2() {
19: m_methodList.add("initDialog2");
20: ppp(" INIT 2");
21: }
22:
23: @AfterMethod
24: public void tearDownDialog2() {
25: m_methodList.add("tearDownDialog2");
26: ppp(" TEAR_DOWN 2");
27: }
28:
29: @Test(groups={"before"})
30: public void test() {
31: m_methodList.add("test");
32: ppp(" TEST");
33: }
34:
35: private static void ppp(String s) {
36: if (m_verbose) {
37: System.out.println("[D2] " + s);
38: }
39: }
40: }
|