1 package org.testng.annotations; 2 3 import static java.lang.annotation.ElementType.METHOD; 4 5 import java.lang.annotation.Retention; 6 import java.lang.annotation.Target; 7 8 /** 9 * Mark a method as supplying data for a test method. The data provider name 10 * defaults to method name. 11 * The annotated method must return an Object[][] where each 12 * Object[] can be assigned the parameter list of the test method. 13 * The @Test method that wants to receive data from this DataProvider 14 * needs to use a dataProvider name equals to the name of this annotation. 15 * 16 * @author cbeust 17 */ 18 @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) 19 @Target({METHOD}) 20 public @interface DataProvider { 21 22 /** 23 * The name of this DataProvider. 24 */ name()25 public String name() default ""; 26 27 /** 28 * Whether this data provider should be run in parallel. 29 */ parallel()30 boolean parallel() default false; 31 32 /** 33 * Which indices to run from this data provider, default: all. 34 */ indices()35 int[] indices() default {}; 36 } 37