01: package test.dataprovider;
02:
03: import org.testng.annotations.DataProvider;
04: import org.testng.annotations.Test;
05:
06: public class CreateDataTest {
07:
08: /**
09: * @testng.data-provider name = "create-data"
10: */
11: @DataProvider(name="create-data")
12: public Object[][] create() {
13: return new Object[][] { new Object[] { new MyObject() } };
14: }
15:
16: /**
17: * @testng.test data-provider = "create-data"
18: */
19: @Test(dataProvider="create-data")
20: public void testMyTest(MyObject o) {
21: // do something with o
22: }
23:
24: }
25:
26: class MyObject {
27: }
|