Package org.testng.internal.annotations
Class ConfigurationAnnotation
- java.lang.Object
-
- org.testng.internal.annotations.BaseAnnotation
-
- org.testng.internal.annotations.TestOrConfiguration
-
- org.testng.internal.annotations.ConfigurationAnnotation
-
- All Implemented Interfaces:
IAnnotation
,IConfigurationAnnotation
,IParameterizable
,ITestOrConfiguration
,IAfterClass
,IAfterGroups
,IAfterMethod
,IAfterSuite
,IAfterTest
,IBaseBeforeAfter
,IBeforeClass
,IBeforeGroups
,IBeforeMethod
,IBeforeSuite
,IBeforeTest
public class ConfigurationAnnotation extends TestOrConfiguration implements IConfigurationAnnotation, IBeforeSuite, IAfterSuite, IBeforeTest, IAfterTest, IBeforeGroups, IAfterGroups, IBeforeClass, IAfterClass, IBeforeMethod, IAfterMethod
An implementation of IConfiguration Created on Dec 16, 2005
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
m_afterGroups
private boolean
m_afterSuite
private boolean
m_afterTest
private boolean
m_afterTestClass
private boolean
m_afterTestMethod
private boolean
m_alwaysRun
private java.lang.String[]
m_beforeGroups
private boolean
m_beforeSuite
private boolean
m_beforeTest
private boolean
m_beforeTestClass
private boolean
m_beforeTestMethod
private boolean
m_firstTimeOnly
private boolean
m_inheritGroups
private boolean
m_isFakeConfiguration
private boolean
m_lastTimeOnly
private java.lang.String[]
m_parameters
-
Constructor Summary
Constructors Constructor Description ConfigurationAnnotation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getAfterGroups()
The list of groups that this configuration method will run after.boolean
getAfterSuite()
If true, the annotated method will be run after all tests in this suite have run.boolean
getAfterTest()
If true, the annotated method will be run after all every test.boolean
getAfterTestClass()
If true, the annotated method will be run after all the tests in the test class have been run.boolean
getAfterTestMethod()
If true, the annotated method will be run after any test method is invoked.boolean
getAlwaysRun()
Used only for after type of configuration methods.java.lang.String[]
getBeforeGroups()
The list of groups that this configuration method will run before.boolean
getBeforeSuite()
If true, the annotated method will be run before this suite starts.boolean
getBeforeTest()
If true, the annotated method will be run before every testboolean
getBeforeTestClass()
If true, the annotated method will be run after the test class is instantiated and before the test method is invoked.boolean
getBeforeTestMethod()
If true, the annotated method will be run before any test method is invoked.boolean
getInheritGroups()
If true, this @Configuration method will belong to groups specified in the \@Test annotation on the class (if any).java.lang.String[]
getParameters()
The list of variables used to fill the parameters of this method.boolean
isFakeConfiguration()
Internal use only.boolean
isFirstTimeOnly()
boolean
isLastTimeOnly()
void
setAfterGroups(java.lang.String[] afterGroups)
void
setAfterSuite(boolean afterSuite)
void
setAfterTest(boolean afterTest)
void
setAfterTestClass(boolean afterTestClass)
void
setAfterTestMethod(boolean afterTestMethod)
void
setAlwaysRun(boolean alwaysRun)
void
setBeforeGroups(java.lang.String[] beforeGroups)
void
setBeforeSuite(boolean beforeSuite)
void
setBeforeTest(boolean beforeTest)
void
setBeforeTestClass(boolean beforeTestClass)
void
setBeforeTestMethod(boolean beforeTestMethod)
void
setFakeConfiguration(boolean b)
void
setFirstTimeOnly(boolean f)
void
setInheritGroups(boolean inheritGroups)
void
setLastTimeOnly(boolean f)
void
setParameters(java.lang.String[] parameters)
-
Methods inherited from class org.testng.internal.annotations.TestOrConfiguration
getDependsOnGroups, getDependsOnMethods, getDescription, getEnabled, getGroups, getPriority, getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setEnabled, setGroups, setPriority, setTimeOut
-
Methods inherited from class org.testng.internal.annotations.BaseAnnotation
getConstructor, getMethod, getTestClass, setConstructor, setMethod, setTestClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.testng.internal.annotations.IBaseBeforeAfter
getDependsOnGroups, getDependsOnMethods, getDescription, getEnabled, getGroups
-
Methods inherited from interface org.testng.annotations.IParameterizable
setEnabled
-
Methods inherited from interface org.testng.annotations.ITestOrConfiguration
getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setGroups, setTimeOut
-
-
-
-
Field Detail
-
m_beforeTestClass
private boolean m_beforeTestClass
-
m_afterTestClass
private boolean m_afterTestClass
-
m_beforeTestMethod
private boolean m_beforeTestMethod
-
m_afterTestMethod
private boolean m_afterTestMethod
-
m_beforeTest
private boolean m_beforeTest
-
m_afterTest
private boolean m_afterTest
-
m_beforeSuite
private boolean m_beforeSuite
-
m_afterSuite
private boolean m_afterSuite
-
m_parameters
private java.lang.String[] m_parameters
-
m_alwaysRun
private boolean m_alwaysRun
-
m_inheritGroups
private boolean m_inheritGroups
-
m_beforeGroups
private java.lang.String[] m_beforeGroups
-
m_afterGroups
private java.lang.String[] m_afterGroups
-
m_isFakeConfiguration
private boolean m_isFakeConfiguration
-
m_firstTimeOnly
private boolean m_firstTimeOnly
-
m_lastTimeOnly
private boolean m_lastTimeOnly
-
-
Method Detail
-
setAfterSuite
public void setAfterSuite(boolean afterSuite)
-
setAfterTest
public void setAfterTest(boolean afterTest)
-
setAfterTestClass
public void setAfterTestClass(boolean afterTestClass)
-
setAfterTestMethod
public void setAfterTestMethod(boolean afterTestMethod)
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun)
-
setBeforeSuite
public void setBeforeSuite(boolean beforeSuite)
-
setBeforeTest
public void setBeforeTest(boolean beforeTest)
-
setBeforeTestClass
public void setBeforeTestClass(boolean beforeTestClass)
-
setBeforeTestMethod
public void setBeforeTestMethod(boolean beforeTestMethod)
-
setInheritGroups
public void setInheritGroups(boolean inheritGroups)
-
setParameters
public void setParameters(java.lang.String[] parameters)
- Overrides:
setParameters
in classTestOrConfiguration
-
getBeforeTestClass
public boolean getBeforeTestClass()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run after the test class is instantiated and before the test method is invoked.- Specified by:
getBeforeTestClass
in interfaceIConfigurationAnnotation
-
getAfterTestClass
public boolean getAfterTestClass()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run after all the tests in the test class have been run.- Specified by:
getAfterTestClass
in interfaceIConfigurationAnnotation
-
getBeforeTestMethod
public boolean getBeforeTestMethod()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run before any test method is invoked.- Specified by:
getBeforeTestMethod
in interfaceIConfigurationAnnotation
-
getAfterTestMethod
public boolean getAfterTestMethod()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run after any test method is invoked.- Specified by:
getAfterTestMethod
in interfaceIConfigurationAnnotation
-
getBeforeSuite
public boolean getBeforeSuite()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run before this suite starts.- Specified by:
getBeforeSuite
in interfaceIConfigurationAnnotation
-
getAfterSuite
public boolean getAfterSuite()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run after all tests in this suite have run.- Specified by:
getAfterSuite
in interfaceIConfigurationAnnotation
-
getBeforeTest
public boolean getBeforeTest()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run before every test- Specified by:
getBeforeTest
in interfaceIConfigurationAnnotation
-
getAfterTest
public boolean getAfterTest()
Description copied from interface:IConfigurationAnnotation
If true, the annotated method will be run after all every test.- Specified by:
getAfterTest
in interfaceIConfigurationAnnotation
-
getParameters
public java.lang.String[] getParameters()
Description copied from interface:IParameterizable
The list of variables used to fill the parameters of this method. These variables must be defined in the property file.- Specified by:
getParameters
in interfaceIParameterizable
- Overrides:
getParameters
in classTestOrConfiguration
-
getAlwaysRun
public boolean getAlwaysRun()
Description copied from interface:IConfigurationAnnotation
Used only for after type of configuration methods. If set to true than the configuration method will be run whatever the status of before configuration methods was.- Specified by:
getAlwaysRun
in interfaceIBaseBeforeAfter
- Specified by:
getAlwaysRun
in interfaceIConfigurationAnnotation
-
getInheritGroups
public boolean getInheritGroups()
Description copied from interface:IConfigurationAnnotation
If true, this @Configuration method will belong to groups specified in the \@Test annotation on the class (if any).- Specified by:
getInheritGroups
in interfaceIBaseBeforeAfter
- Specified by:
getInheritGroups
in interfaceIConfigurationAnnotation
-
getAfterGroups
public java.lang.String[] getAfterGroups()
Description copied from interface:IConfigurationAnnotation
The list of groups that this configuration method will run after.- Specified by:
getAfterGroups
in interfaceIConfigurationAnnotation
-
setAfterGroups
public void setAfterGroups(java.lang.String[] afterGroups)
-
getBeforeGroups
public java.lang.String[] getBeforeGroups()
Description copied from interface:IConfigurationAnnotation
The list of groups that this configuration method will run before.- Specified by:
getBeforeGroups
in interfaceIConfigurationAnnotation
-
setBeforeGroups
public void setBeforeGroups(java.lang.String[] beforeGroups)
-
setFakeConfiguration
public void setFakeConfiguration(boolean b)
-
isFakeConfiguration
public boolean isFakeConfiguration()
Description copied from interface:IConfigurationAnnotation
Internal use only.- Specified by:
isFakeConfiguration
in interfaceIConfigurationAnnotation
- Returns:
- true if this configuration annotation is not a "true" configuration annotation but a @BeforeSuite or similar that is represented as a configuration annotation.
-
setFirstTimeOnly
public void setFirstTimeOnly(boolean f)
-
isFirstTimeOnly
public boolean isFirstTimeOnly()
-
setLastTimeOnly
public void setLastTimeOnly(boolean f)
-
isLastTimeOnly
public boolean isLastTimeOnly()
-
-