1 package org.testng.annotations; 2 3 import static java.lang.annotation.ElementType.CONSTRUCTOR; 4 import static java.lang.annotation.ElementType.METHOD; 5 import static java.lang.annotation.ElementType.TYPE; 6 import static java.lang.annotation.RetentionPolicy.RUNTIME; 7 8 import java.lang.annotation.Retention; 9 import java.lang.annotation.Target; 10 11 /** 12 * Describes how to pass parameters to a @Test method. 13 * 14 * @author <a href="mailto:cedric@beust.com">Cedric Beust</a> 15 */ 16 @Retention(RUNTIME) 17 @Target({METHOD, CONSTRUCTOR, TYPE }) 18 public @interface Parameters { 19 /** 20 * The list of variables used to fill the parameters of this method. 21 * These variables must be defined in your testng.xml file. 22 * For example 23 * <p> 24 * <code> 25 * @Parameters({ "xmlPath" })<br> 26 * @Test<br> 27 * public void verifyXmlFile(String path) { ... }<br> 28 * </code> 29 * <p>and in <tt>testng.xml</tt>:<p> 30 * <code> 31 * <parameter name="xmlPath" value="account.xml" /><br> 32 * </code> 33 */ 34 public String[] value() default {}; 35 } 36