Package org.testng.internal.annotations
Class TestAnnotation
- java.lang.Object
-
- org.testng.internal.annotations.BaseAnnotation
-
- org.testng.internal.annotations.TestOrConfiguration
-
- org.testng.internal.annotations.TestAnnotation
-
- All Implemented Interfaces:
IAnnotation
,IParameterizable
,ITestAnnotation
,ITestOrConfiguration
,IDataProvidable
public class TestAnnotation extends TestOrConfiguration implements ITestAnnotation
An implementation of ITest
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
m_alwaysRun
private CustomAttribute[]
m_attributes
private java.lang.String
m_dataProvider
private java.lang.Class<?>
m_dataProviderClass
private java.lang.Class<?>[]
m_expectedExceptions
private java.lang.String
m_expectedExceptionsMessageRegExp
private boolean
m_ignoreMissingDependencies
private int
m_invocationCount
private long
m_invocationTimeOut
private IRetryAnalyzer
m_retryAnalyzer
private java.lang.Class<? extends IRetryAnalyzer>
m_retryAnalyzerClass
private boolean
m_singleThreaded
private boolean
m_skipFailedInvocations
private int
m_successPercentage
private java.lang.String
m_suiteName
private java.lang.String
m_testName
private int
m_threadPoolSize
-
Constructor Summary
Constructors Constructor Description TestAnnotation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAlwaysRun()
If set to true, this test method will always be run even if it depends on a method that failed.CustomAttribute[]
getAttributes()
java.lang.String
getDataProvider()
java.lang.Class<?>
getDataProviderClass()
java.lang.Class<?>[]
getExpectedExceptions()
java.lang.String
getExpectedExceptionsMessageRegExp()
int
getInvocationCount()
Returns the number of times this method should be invoked.IRetryAnalyzer
getRetryAnalyzer()
java.lang.Class<? extends IRetryAnalyzer>
getRetryAnalyzerClass()
boolean
getSingleThreaded()
int
getSuccessPercentage()
The percentage of success expected from this method.java.lang.String
getSuiteName()
java.lang.String
getTestName()
int
getThreadPoolSize()
The size of the thread pool for this method.boolean
ignoreMissingDependencies()
long
invocationTimeOut()
private static boolean
isRetryAnalyzerNotTestNGInjected(java.lang.Class<? extends IRetryAnalyzer> c)
void
setAlwaysRun(boolean alwaysRun)
void
setAttributes(CustomAttribute[] attributes)
void
setDataProvider(java.lang.String dataProvider)
void
setDataProviderClass(java.lang.Class<?> dataProviderClass)
void
setExpectedExceptions(java.lang.Class<?>[] expectedExceptions)
void
setExpectedExceptionsMessageRegExp(java.lang.String expectedExceptionsMessageRegExp)
void
setIgnoreMissingDependencies(boolean ignore)
void
setInvocationCount(int invocationCount)
void
setInvocationTimeOut(long timeOut)
void
setRetryAnalyzer(java.lang.Class<? extends IRetryAnalyzer> c)
void
setSingleThreaded(boolean singleThreaded)
void
setSkipFailedInvocations(boolean skip)
void
setSuccessPercentage(int successPercentage)
void
setSuiteName(java.lang.String xmlSuite)
void
setTestName(java.lang.String xmlTest)
void
setThreadPoolSize(int threadPoolSize)
boolean
skipFailedInvocations()
-
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.annotations.IParameterizable
getEnabled, setEnabled
-
Methods inherited from interface org.testng.annotations.ITestAnnotation
getPriority, setPriority
-
Methods inherited from interface org.testng.annotations.ITestOrConfiguration
getDependsOnGroups, getDependsOnMethods, getDescription, getGroups, getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setGroups, setTimeOut
-
-
-
-
Field Detail
-
m_invocationTimeOut
private long m_invocationTimeOut
-
m_invocationCount
private int m_invocationCount
-
m_threadPoolSize
private int m_threadPoolSize
-
m_successPercentage
private int m_successPercentage
-
m_dataProvider
private java.lang.String m_dataProvider
-
m_alwaysRun
private boolean m_alwaysRun
-
m_expectedExceptions
private java.lang.Class<?>[] m_expectedExceptions
-
m_expectedExceptionsMessageRegExp
private java.lang.String m_expectedExceptionsMessageRegExp
-
m_suiteName
private java.lang.String m_suiteName
-
m_testName
private java.lang.String m_testName
-
m_singleThreaded
private boolean m_singleThreaded
-
m_dataProviderClass
private java.lang.Class<?> m_dataProviderClass
-
m_retryAnalyzer
private IRetryAnalyzer m_retryAnalyzer
-
m_retryAnalyzerClass
private java.lang.Class<? extends IRetryAnalyzer> m_retryAnalyzerClass
-
m_skipFailedInvocations
private boolean m_skipFailedInvocations
-
m_ignoreMissingDependencies
private boolean m_ignoreMissingDependencies
-
m_attributes
private CustomAttribute[] m_attributes
-
-
Method Detail
-
getExpectedExceptions
public java.lang.Class<?>[] getExpectedExceptions()
- Specified by:
getExpectedExceptions
in interfaceITestAnnotation
- Returns:
- the expectedExceptions
-
setExpectedExceptions
public void setExpectedExceptions(java.lang.Class<?>[] expectedExceptions)
- Specified by:
setExpectedExceptions
in interfaceITestAnnotation
- Parameters:
expectedExceptions
- the expectedExceptions to set
-
getExpectedExceptionsMessageRegExp
public java.lang.String getExpectedExceptionsMessageRegExp()
- Specified by:
getExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setExpectedExceptionsMessageRegExp
public void setExpectedExceptionsMessageRegExp(java.lang.String expectedExceptionsMessageRegExp)
- Specified by:
setExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun)
- Specified by:
setAlwaysRun
in interfaceITestAnnotation
-
setDataProvider
public void setDataProvider(java.lang.String dataProvider)
- Specified by:
setDataProvider
in interfaceIDataProvidable
- Specified by:
setDataProvider
in interfaceITestAnnotation
-
getDataProviderClass
public java.lang.Class<?> getDataProviderClass()
- Specified by:
getDataProviderClass
in interfaceIDataProvidable
- Specified by:
getDataProviderClass
in interfaceITestAnnotation
-
setDataProviderClass
public void setDataProviderClass(java.lang.Class<?> dataProviderClass)
- Specified by:
setDataProviderClass
in interfaceIDataProvidable
- Specified by:
setDataProviderClass
in interfaceITestAnnotation
-
setInvocationCount
public void setInvocationCount(int invocationCount)
- Specified by:
setInvocationCount
in interfaceITestAnnotation
-
setSuccessPercentage
public void setSuccessPercentage(int successPercentage)
- Specified by:
setSuccessPercentage
in interfaceITestAnnotation
-
getInvocationCount
public int getInvocationCount()
Description copied from interface:ITestAnnotation
Returns the number of times this method should be invoked.- Specified by:
getInvocationCount
in interfaceITestAnnotation
- Returns:
- the number of times this method should be invoked.
-
invocationTimeOut
public long invocationTimeOut()
- Specified by:
invocationTimeOut
in interfaceITestAnnotation
-
setInvocationTimeOut
public void setInvocationTimeOut(long timeOut)
- Specified by:
setInvocationTimeOut
in interfaceITestAnnotation
-
getSuccessPercentage
public int getSuccessPercentage()
Description copied from interface:ITestAnnotation
The percentage of success expected from this method.- Specified by:
getSuccessPercentage
in interfaceITestAnnotation
- Returns:
- the value
-
getDataProvider
public java.lang.String getDataProvider()
- Specified by:
getDataProvider
in interfaceIDataProvidable
- Specified by:
getDataProvider
in interfaceITestAnnotation
-
getAlwaysRun
public boolean getAlwaysRun()
Description copied from interface:ITestAnnotation
If set to true, this test method will always be run even if it depends on a method that failed. This attribute will be ignored if this test doesn't depend on any method or group.- Specified by:
getAlwaysRun
in interfaceITestAnnotation
- Returns:
- the value
-
getThreadPoolSize
public int getThreadPoolSize()
Description copied from interface:ITestAnnotation
The size of the thread pool for this method. The method will be invoked from multiple threads as specified by invocationCount. Note: this attribute is ignored if invocationCount is not specified- Specified by:
getThreadPoolSize
in interfaceITestAnnotation
- Returns:
- the value
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize)
- Specified by:
setThreadPoolSize
in interfaceITestAnnotation
-
getSuiteName
public java.lang.String getSuiteName()
- Specified by:
getSuiteName
in interfaceITestAnnotation
-
setSuiteName
public void setSuiteName(java.lang.String xmlSuite)
- Specified by:
setSuiteName
in interfaceITestAnnotation
-
getTestName
public java.lang.String getTestName()
- Specified by:
getTestName
in interfaceITestAnnotation
-
setTestName
public void setTestName(java.lang.String xmlTest)
- Specified by:
setTestName
in interfaceITestAnnotation
-
getSingleThreaded
public boolean getSingleThreaded()
- Specified by:
getSingleThreaded
in interfaceITestAnnotation
-
setSingleThreaded
public void setSingleThreaded(boolean singleThreaded)
- Specified by:
setSingleThreaded
in interfaceITestAnnotation
-
getRetryAnalyzer
public IRetryAnalyzer getRetryAnalyzer()
- Specified by:
getRetryAnalyzer
in interfaceITestAnnotation
- Returns:
- The retry analyzer
-
setRetryAnalyzer
public void setRetryAnalyzer(java.lang.Class<? extends IRetryAnalyzer> c)
- Specified by:
setRetryAnalyzer
in interfaceITestAnnotation
-
getRetryAnalyzerClass
public java.lang.Class<? extends IRetryAnalyzer> getRetryAnalyzerClass()
- Specified by:
getRetryAnalyzerClass
in interfaceITestAnnotation
-
setSkipFailedInvocations
public void setSkipFailedInvocations(boolean skip)
- Specified by:
setSkipFailedInvocations
in interfaceITestAnnotation
-
skipFailedInvocations
public boolean skipFailedInvocations()
- Specified by:
skipFailedInvocations
in interfaceITestAnnotation
-
setIgnoreMissingDependencies
public void setIgnoreMissingDependencies(boolean ignore)
- Specified by:
setIgnoreMissingDependencies
in interfaceITestAnnotation
-
ignoreMissingDependencies
public boolean ignoreMissingDependencies()
- Specified by:
ignoreMissingDependencies
in interfaceITestAnnotation
-
getAttributes
public CustomAttribute[] getAttributes()
- Specified by:
getAttributes
in interfaceITestAnnotation
-
setAttributes
public void setAttributes(CustomAttribute[] attributes)
- Specified by:
setAttributes
in interfaceITestAnnotation
-
isRetryAnalyzerNotTestNGInjected
private static boolean isRetryAnalyzerNotTestNGInjected(java.lang.Class<? extends IRetryAnalyzer> c)
-
-