1 package org.testng.annotations;
2 
3 import java.lang.annotation.Retention;
4 import java.lang.annotation.Target;
5 
6 @Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
7 @Target(java.lang.annotation.ElementType.METHOD)
8 public @interface BeforeTest {
9   /**
10    * Whether methods on this class/method are enabled.
11    */
enabled()12   public boolean enabled() default true;
13 
14   /**
15    * The list of groups this class/method belongs to.
16    */
groups()17   public String[] groups() default {};
18 
19   /**
20    * The list of groups this method depends on.  Every method
21    * member of one of these groups is guaranteed to have been
22    * invoked before this method.  Furthermore, if any of these
23    * methods was not a SUCCESS, this test method will not be
24    * run and will be flagged as a SKIP.
25    */
dependsOnGroups()26   public String[] dependsOnGroups() default {};
27 
28   /**
29    * The list of methods this method depends on.  There is no guarantee
30    * on the order on which the methods depended upon will be run, but you
31    * are guaranteed that all these methods will be run before the test method
32    * that contains this annotation is run.  Furthermore, if any of these
33    * methods was not a SUCCESS, this test method will not be
34    * run and will be flagged as a SKIP.
35    *
36    *  If some of these methods have been overloaded, all the overloaded
37    *  versions will be run.
38    */
dependsOnMethods()39   public String[] dependsOnMethods() default {};
40 
41   /**
42    *  For before methods (beforeSuite, beforeTest, beforeTestClass and
43    *  beforeTestMethod, but not beforeGroups):
44    *  If set to true, this configuration method will be run
45    *  regardless of what groups it belongs to.
46    *  <br>
47    * For after methods (afterSuite, afterClass, ...):
48    *  If set to true, this configuration method will be run
49    *  even if one or more methods invoked previously failed or
50    *  was skipped.
51    */
alwaysRun()52   public boolean alwaysRun() default false;
53 
54   /**
55    * If true, this &#64;Configuration method will belong to groups specified in the
56    * &#64;Test annotation on the class (if any).
57    */
inheritGroups()58   public boolean inheritGroups() default true;
59 
60   /**
61    * The description for this method.  The string used will appear in the
62    * HTML report and also on standard output if verbose >= 2.
63    */
description()64   public String description() default "";
65 
66   /**
67    * The maximum number of milliseconds this method should take.
68    * If it hasn't returned after this time, this method will fail and
69    * it will cause test methods depending on it to be skipped.
70    */
timeOut()71   public long timeOut() default 0;
72 }
73