01: package test.methods;
02:
03: import org.testng.annotations.*;
04:
05: /**
06: * This class is used to test invocation of methods
07: *
08: * @author cbeust
09: */
10: public class SampleMethod1 {
11: private static boolean m_ok1 = false;
12: private static boolean m_ok2 = false;
13: private static boolean m_ok3 = true;
14: private static boolean m_ok4 = true;
15:
16: public static void reset() {
17: m_ok1 = false;
18: m_ok2 = false;
19: m_ok3 = true;
20: m_ok4 = true;
21: }
22:
23: @Test(groups={"sample1"})
24: public void shouldRun1() {
25: m_ok1 = true;
26: }
27:
28: @Test(groups={"sample1"})
29: public void shouldRun2() {
30: m_ok2 = true;
31: }
32:
33: @Test
34: public void shouldNotRun1() {
35: m_ok3 = false;
36: }
37:
38: @Test
39: public void shouldNotRun2() {
40: m_ok4 = false;
41: }
42:
43: public static void verify() {
44: assert m_ok1 && m_ok2 && m_ok3 && m_ok4 : "All booleans should be true: "
45: + m_ok1 + " " + m_ok2 + " " + m_ok3 + " " + m_ok4;
46: }
47:
48: static private void ppp(String s) {
49: System.out.println("[SampleMethod1] " + s);
50: }
51:
52: }
|