01: package test.dataprovider;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.DataProvider;
05: import org.testng.annotations.Test;
06:
07: public class BooleanTest {
08: private boolean m_false = false;
09: private boolean m_true = false;
10:
11: @Test(dataProvider="allBooleans")
12: public void doStuff(boolean t) {
13: if (t)
14: m_true = true;
15: if (!t)
16: m_false = true;
17: }
18:
19: @Test(dependsOnMethods={"doStuff"})
20: public void verify() {
21: Assert.assertTrue(m_true);
22: Assert.assertTrue(m_false);
23: }
24:
25: private void ppp(String string) {
26: System.out.println("[BooleanTest] " + string);
27: }
28:
29: @DataProvider(name="allBooleans")
30: public Object[][] createData() {
31: return new Object[][] { new Object[] { true },
32: new Object[] { false }, };
33: }
34:
35: }
|