1 package test.tmp; 2 3 import org.testng.annotations.BeforeMethod; 4 import org.testng.annotations.DataProvider; 5 import org.testng.annotations.Test; 6 7 public class C { 8 @BeforeMethod cm()9 public void cm() { 10 // System.out.println("C.cm"); 11 } 12 13 @Test(dataProvider = "data") c(String s)14 public void c(String s) { 15 System.out.println("c(" + s + ")"); 16 } 17 18 @DataProvider(name = "data") data()19 static public Object[][] data() { 20 return new Object[][] { 21 new Object[] { "Foo" }, 22 new Object[] { "Bar" }, 23 }; 24 } 25 } 26