1 package test.inheritance;
2 
3 import org.testng.annotations.AfterMethod;
4 import org.testng.annotations.BeforeMethod;
5 import org.testng.annotations.Test;
6 
7 /**
8  * Make sure that configuration inherited methods are invoked in the right
9  * 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
initDialog2()18   public void initDialog2() {
19     m_methodList.add("initDialog2");
20     ppp("    INIT 2");
21   }
22 
23   @AfterMethod
tearDownDialog2()24   public void tearDownDialog2() {
25     m_methodList.add("tearDownDialog2");
26     ppp("    TEAR_DOWN 2");
27   }
28 
29   @Test(groups = {"before" })
test()30   public void test() {
31     m_methodList.add("test");
32     ppp("      TEST");
33   }
34 
ppp(String s)35   private static void ppp(String s) {
36     if (m_verbose) {
37       System.out.println("[D2] " + s);
38     }
39   }
40 }
41