01: package test.dataprovider;
02:
03: import org.testng.Assert;
04:
05: public abstract class AbstractRootDataProvider {
06: protected boolean m_ok1 = false;
07: protected boolean m_ok2 = false;
08: protected boolean m_ok3 = false;
09: protected boolean m_ok4 = false;
10:
11: static final String FN2 = "Anne Marie";
12: static final Integer LN2 = new Integer(37);
13: static final String FN1 = "Cedric";
14: static final Integer LN1 = new Integer(36);
15:
16: /**
17: * @testng.data-provider name="test1"
18: */
19: public Object[][] createData() {
20: return new Object[][] { new Object[] { FN1, LN1 },
21: new Object[] { FN2, LN2 }, };
22: }
23:
24: /**
25: * @testng.test dataProvider="test1"
26: */
27: public void parentTest(String firstName, Integer age) {
28: if (firstName.equals(FN1) && age.equals(LN1)) {
29: m_ok1 = true;
30: }
31: if (firstName.equals(FN2) && age.equals(LN2)) {
32: m_ok2 = true;
33: }
34: }
35:
36: /**
37: * @testng.test dependsOnMethods = "parentTest"
38: */
39: public void verifyParentCount() {
40: Assert.assertTrue(m_ok1 && m_ok2);
41: }
42: }
|