01: package test.dataprovider;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.DataProvider;
05: import org.testng.annotations.Test;
06:
07: /**
08: * This class/interface
09: */
10: public class UnnamedDataProviderTest {
11: private boolean m_false = false;
12: private boolean m_true = false;
13:
14: @Test(dataProvider="unnamedDataProvider")
15: public void doStuff(boolean t) {
16: if (t)
17: m_true = true;
18: if (!t)
19: m_false = true;
20: }
21:
22: @Test(dependsOnMethods={"doStuff"})
23: public void verify() {
24: Assert.assertTrue(m_true);
25: Assert.assertTrue(m_false);
26: }
27:
28: @DataProvider
29: public Object[][] unnamedDataProvider() {
30: return new Object[][] { { Boolean.TRUE }, { Boolean.FALSE } };
31: }
32: }
|