Package guru.mikelue.jdut.testng
Annotation Type TestNGConfig
-
@Target({ANNOTATION_TYPE,CONSTRUCTOR,FIELD,LOCAL_VARIABLE,METHOD,PACKAGE,PARAMETER,TYPE,TYPE_PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Documented @Inherited public @interface TestNGConfig
Defines the behaviours working byIInvokedMethodYamlFactoryListener.
With@TestNGConfig(oneTimeOnly=true), the data conductor performs actions only on first time and last time of multiple tests on a testing method.For example(by
DataProvider):@Test @TestNGConfig(oneTimeOnly=true) @JdutResource public void mixStuff(int speed) { // Executes tested code // Assertions ... } // Executes DuetConductor.build() before case of "0". // Executes DuetConductor.clean() after case of "1275". @DataProvider Object[][] mixStuff() { return new Object[][] { { 0 }, { 30 }, { 2000 }, { -1 }, { 50000 }, { 1275 }, }; }
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanoneTimeOnlyWith using ofDataProvider, set this field to true to build data only once before first invocation and after last invocation.
-
-
-
Element Detail
-
oneTimeOnly
boolean oneTimeOnly
With using ofDataProvider, set this field to true to build data only once before first invocation and after last invocation.- Returns:
- true if conduction data one time only
- Default:
- false
-
-