01: package test.tmp;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.Configuration;
05: import org.testng.annotations.Test;
06:
07: @Test(groups={"sub"})
08: public class Sub extends Base {
09: boolean m_beforeTest;
10: boolean m_afterTest;
11:
12: @Configuration(beforeTestClass=true)
13: public void subSetup() {
14: System.out.println("sub before class");
15: }
16:
17: @Configuration(afterTestClass=true)
18: public void subTeardown() {
19: System.out.println("sub after class");
20: }
21:
22: public void subTest() {
23: System.out.println("sub test");
24: }
25:
26: @Configuration(afterSuite=true)
27: public void verify() {
28: Assert.assertTrue(m_beforeTest);
29: Assert.assertTrue(m_afterTest);
30: }
31: }
|