001: package org.testng.annotations;
002:
003: import java.lang.annotation.Target;
004: import java.lang.annotation.Retention;
005:
006: /**
007: * Configuration information for a TestNG class.
008: *
009: * @deprecated Use @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest,
010: * @BeforeGroups, @AfterGroups, @BeforeClass, @AfterClass, @BeforeMethod,
011: * @AfterMethod
012: *
013: * @author Cedric Beust, Apr 26, 2004
014: *
015: */
016: @Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
017: @Target(java.lang.annotation.ElementType.METHOD)
018: public @interface Configuration {
019:
020: /**
021: * If true, the annotated method will be run after the test class is instantiated
022: * and before the test method is invoked.
023: */
024: public boolean beforeTestClass() default false;
025:
026: /**
027: * If true, the annotated method will be run after all the tests in the test
028: * class have been run.
029: */
030: public boolean afterTestClass() default false;
031:
032: /**
033: * If true, the annotated method will be run before any test method is invoked.
034: */
035: public boolean beforeTestMethod() default false;
036:
037: /**
038: * If true, the annotated method will be run after any test method is invoked.
039: */
040: public boolean afterTestMethod() default false;
041:
042: /**
043: * If true, the annotated method will be run before this suite starts.
044: */
045: public boolean beforeSuite() default false;
046:
047: /**
048: * If true, the annotated method will be run after all tests in this suite
049: * have run.
050: */
051: public boolean afterSuite() default false;
052:
053: /**
054: * If true, the annotated method will be run before every test.
055: */
056: public boolean beforeTest() default false;
057:
058: /**
059: * If true, the annotated method will be run after all every test.
060: */
061: public boolean afterTest() default false;
062:
063: /**
064: * The list of groups that this configuration method will run before.
065: * This method is guaranteed to run shortly before the first test method that
066: * belongs to any of these groups is invoked.
067: */
068: public String[] beforeGroups() default {};
069:
070: /**
071: * The list of groups that this configuration method will run after.
072: * This method is guaranteed to run shortly after the last test method that
073: * belongs to any of these groups is invoked.
074: */
075: public String[] afterGroups() default {};
076:
077: /**
078: * The list of variables used to fill the parameters of this method.
079: * These variables must be defined in the property file.
080: *
081: * @deprecated Use @Parameters
082: */
083: @Deprecated
084: public String[] parameters() default {};
085:
086: /**
087: * Whether methods on this class/method are enabled.
088: */
089: public boolean enabled() default true;
090:
091: /**
092: * The list of groups this class/method belongs to.
093: */
094: public String[] groups() default {};
095:
096: /**
097: * The list of groups this method depends on. Every method
098: * member of one of these groups is guaranteed to have been
099: * invoked before this method. Furthermore, if any of these
100: * methods was not a SUCCESS, this test method will not be
101: * run and will be flagged as a SKIP.
102: */
103: public String[] dependsOnGroups() default {};
104:
105: /**
106: * The list of methods this method depends on. There is no guarantee
107: * on the order on which the methods depended upon will be run, but you
108: * are guaranteed that all these methods will be run before the test method
109: * that contains this annotation is run. Furthermore, if any of these
110: * methods was not a SUCCESS, this test method will not be
111: * run and will be flagged as a SKIP.
112: *
113: * If some of these methods have been overloaded, all the overloaded
114: * versions will be run.
115: */
116: public String[] dependsOnMethods() default {};
117:
118: /**
119: * For before methods (beforeSuite, beforeTest, beforeTestClass and
120: * beforeTestMethod, but not beforeGroups):
121: * If set to true, this configuration method will be run
122: * regardless of what groups it belongs to.
123: * <br>
124: * For after methods (afterSuite, afterClass, ...):
125: * If set to true, this configuration method will be run
126: * even if one or more methods invoked previously failed or
127: * was skipped.
128: */
129: public boolean alwaysRun() default false;
130:
131: /**
132: * If true, this @Configuration method will belong to groups specified in the
133: * @Test annotation on the class (if any).
134: */
135: public boolean inheritGroups() default true;
136:
137: /**
138: * The description for this method. The string used will appear in the
139: * HTML report and also on standard output if verbose >= 2.
140: */
141: public String description() default "";
142: }
|