01: package test.configuration;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import org.testng.annotations.AfterGroups;
07: import org.testng.annotations.BeforeGroups;
08: import org.testng.annotations.Test;
09:
10: public class ConfigurationGroupInvocationCountSampleTest {
11: static List<Integer> m_list = new ArrayList<Integer>();
12:
13: @BeforeGroups(groups={"twice"},value={"twice"})
14: public void a() {
15: ppp("BEFORE()");
16: m_list.add(1);
17: }
18:
19: @Test(groups={"twice"},invocationCount=3)
20: public void b() {
21: m_list.add(2);
22: ppp("B()");
23: }
24:
25: @AfterGroups(groups={"twice"},value={"twice"})
26: public void c() {
27: m_list.add(3);
28: ppp("AFTER()");
29: }
30:
31: private void ppp(String string) {
32: if (false) {
33: System.out.println("[A] " + string);
34: }
35: }
36:
37: }
|