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
An implementation of ITest
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private CustomAttribute[]
private String
private Class<?>
private Class<?>[]
private String
private boolean
private int
private long
private Class<? extends IRetryAnalyzer>
private boolean
private boolean
private int
private String
private String
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
If set to true, this test method will always be run even if it depends on a method that failed.Class<?>
Class<?>[]
int
Returns the number of times this method should be invoked.Class<? extends IRetryAnalyzer>
boolean
int
The percentage of success expected from this method.int
The size of the thread pool for this method.boolean
long
private static boolean
isRetryAnalyzerNotTestNGInjected
(Class<? extends IRetryAnalyzer> c) void
setAlwaysRun
(boolean alwaysRun) void
setAttributes
(CustomAttribute[] attributes) void
setDataProvider
(String dataProvider) void
setDataProviderClass
(Class<?> dataProviderClass) void
setExpectedExceptions
(Class<?>[] expectedExceptions) void
setExpectedExceptionsMessageRegExp
(String expectedExceptionsMessageRegExp) void
setIgnoreMissingDependencies
(boolean ignore) void
setInvocationCount
(int invocationCount) void
setInvocationTimeOut
(long timeOut) void
setRetryAnalyzer
(Class<? extends IRetryAnalyzer> c) void
setSingleThreaded
(boolean singleThreaded) void
setSkipFailedInvocations
(boolean skip) void
setSuccessPercentage
(int successPercentage) void
setSuiteName
(String xmlSuite) void
setTestName
(String xmlTest) void
setThreadPoolSize
(int threadPoolSize) boolean
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 Details
-
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
-
m_alwaysRun
private boolean m_alwaysRun -
m_expectedExceptions
-
m_expectedExceptionsMessageRegExp
-
m_suiteName
-
m_testName
-
m_singleThreaded
private boolean m_singleThreaded -
m_dataProviderClass
-
m_retryAnalyzerClass
-
m_skipFailedInvocations
private boolean m_skipFailedInvocations -
m_ignoreMissingDependencies
private boolean m_ignoreMissingDependencies -
m_attributes
-
-
Constructor Details
-
TestAnnotation
public TestAnnotation()
-
-
Method Details
-
getExpectedExceptions
- Specified by:
getExpectedExceptions
in interfaceITestAnnotation
- Returns:
- the expectedExceptions
-
setExpectedExceptions
- Specified by:
setExpectedExceptions
in interfaceITestAnnotation
- Parameters:
expectedExceptions
- the expectedExceptions to set
-
getExpectedExceptionsMessageRegExp
- Specified by:
getExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setExpectedExceptionsMessageRegExp
- Specified by:
setExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun) - Specified by:
setAlwaysRun
in interfaceITestAnnotation
-
setDataProvider
- Specified by:
setDataProvider
in interfaceIDataProvidable
- Specified by:
setDataProvider
in interfaceITestAnnotation
-
getDataProviderClass
- Specified by:
getDataProviderClass
in interfaceIDataProvidable
- Specified by:
getDataProviderClass
in interfaceITestAnnotation
-
setDataProviderClass
- 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
- 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
- Specified by:
getSuiteName
in interfaceITestAnnotation
-
setSuiteName
- Specified by:
setSuiteName
in interfaceITestAnnotation
-
getTestName
- Specified by:
getTestName
in interfaceITestAnnotation
-
setTestName
- 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
-
setRetryAnalyzer
- Specified by:
setRetryAnalyzer
in interfaceITestAnnotation
-
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
- Specified by:
getAttributes
in interfaceITestAnnotation
-
setAttributes
- Specified by:
setAttributes
in interfaceITestAnnotation
-
isRetryAnalyzerNotTestNGInjected
-