01: package test;
02:
03: import org.testng.annotations.Test;
04:
05: public class Exclude {
06: private boolean m_included1 = false;
07: private boolean m_included2 = false;
08: private boolean m_excluded1 = true;
09: private boolean m_excluded2 = true;
10:
11: @Test(groups={"group1"})
12: public void included1() {
13: ppp("INCLUDED1");
14: m_included1 = true;
15: }
16:
17: @Test(groups={"group1"})
18: public void included2() {
19: ppp("INCLUDED2");
20: m_included2 = true;
21: }
22:
23: @Test(groups={"group1"})
24: public void excluded1() {
25: ppp("EXCLUDED1");
26: m_excluded1 = false;
27: }
28:
29: @Test(groups={"group1"})
30: public void excluded2() {
31: ppp("EXCLUDED1");
32: m_excluded2 = false;
33: }
34:
35: @Test(dependsOnGroups={"group1"},groups={"group2"})
36: public void verify() {
37: ppp("VERIFY");
38: assert m_included1 && m_included2 && m_excluded1 && m_excluded2 : "Should all be true: "
39: + m_included1
40: + " "
41: + m_included2
42: + " "
43: + m_excluded1
44: + " " + m_excluded2;
45: }
46:
47: static private void ppp(String s) {
48: if (false) {
49: System.out.println("[Exclude] " + s);
50: }
51: }
52:
53: }
|