01: package test.dependent;
02:
03: /**
04: * This class tests overloaded dependent methods
05: *
06: * @author Cedric Beust, Aug 19, 2004
07: *
08: */
09: public class SampleDependentMethods3 {
10: private boolean m_oneA = false;
11: private boolean m_oneB = false;
12: private boolean m_secondA = false;
13:
14: /**
15: * @testng.test
16: */
17: public void one() {
18: // ppp("oneA");
19: assert !m_secondA : "secondA shouldn't have been run yet";
20: m_oneA = true;
21: }
22:
23: /**
24: * @testng.parameters value = "foo"
25: * @testng.test
26: */
27: public void one(String s) {
28: // ppp("oneB");
29: assert !m_secondA : "secondA shouldn't have been run yet";
30: assert "Cedric".equals(s) : "Expected parameter value Cedric but got "
31: + s;
32: m_oneB = true;
33: }
34:
35: /**
36: * @testng.test dependsOnMethods = "one"
37: */
38: public void secondA() {
39: // ppp("secondA");
40: assert m_oneA : "SampleDependentMethods3.oneA wasn't run";
41: assert m_oneB : "SampleDependentMethods3.oneB wasn't run";
42: assert !m_secondA : "secondA shouldn't have been run yet";
43: m_secondA = true;
44: }
45:
46: /**
47: * @testng.after-class
48: */
49: public void tearDown() {
50: assert m_oneA : "SampleDependentMethods3.oneA wasn't run";
51: assert m_oneB : "SampleDependentMethods3.oneB wasn't run";
52: assert m_secondA : "secondA wasn't run";
53: }
54:
55: public static void ppp(String s) {
56: System.out.println("[SampleDependentMethods] " + s);
57: }
58: }
|