01: package test.tmp;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.AfterTest;
05: import org.testng.annotations.BeforeGroups;
06: import org.testng.annotations.Test;
07:
08: @Test(groups={"base"})
09: public class Base {
10: private static int m_count = 0;
11:
12: @BeforeGroups(groups="foo")
13: public void beforeGroups() {
14: ppp("BEFORE_GROUPS");
15: m_count++;
16: }
17:
18: @AfterTest
19: public void verify() {
20: Assert.assertEquals(m_count, 1);
21: }
22:
23: private static void ppp(String s) {
24: System.out.println("[Base] " + s);
25: }
26: }
|