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 booleanm_alwaysRunprivate CustomAttribute[]m_attributesprivate java.lang.Stringm_dataProviderprivate java.lang.Class<?>m_dataProviderClassprivate java.lang.Class<?>[]m_expectedExceptionsprivate java.lang.Stringm_expectedExceptionsMessageRegExpprivate booleanm_ignoreMissingDependenciesprivate intm_invocationCountprivate longm_invocationTimeOutprivate IRetryAnalyzerm_retryAnalyzerprivate java.lang.Class<? extends IRetryAnalyzer>m_retryAnalyzerClassprivate booleanm_singleThreadedprivate booleanm_skipFailedInvocationsprivate intm_successPercentageprivate java.lang.Stringm_suiteNameprivate java.lang.Stringm_testNameprivate intm_threadPoolSize
-
Constructor Summary
Constructors Constructor Description TestAnnotation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetAlwaysRun()If set to true, this test method will always be run even if it depends on a method that failed.CustomAttribute[]getAttributes()java.lang.StringgetDataProvider()java.lang.Class<?>getDataProviderClass()java.lang.Class<?>[]getExpectedExceptions()java.lang.StringgetExpectedExceptionsMessageRegExp()intgetInvocationCount()Returns the number of times this method should be invoked.IRetryAnalyzergetRetryAnalyzer()java.lang.Class<? extends IRetryAnalyzer>getRetryAnalyzerClass()booleangetSingleThreaded()intgetSuccessPercentage()The percentage of success expected from this method.java.lang.StringgetSuiteName()java.lang.StringgetTestName()intgetThreadPoolSize()The size of the thread pool for this method.booleanignoreMissingDependencies()longinvocationTimeOut()private static booleanisRetryAnalyzerNotTestNGInjected(java.lang.Class<? extends IRetryAnalyzer> c)voidsetAlwaysRun(boolean alwaysRun)voidsetAttributes(CustomAttribute[] attributes)voidsetDataProvider(java.lang.String dataProvider)voidsetDataProviderClass(java.lang.Class<?> dataProviderClass)voidsetExpectedExceptions(java.lang.Class<?>[] expectedExceptions)voidsetExpectedExceptionsMessageRegExp(java.lang.String expectedExceptionsMessageRegExp)voidsetIgnoreMissingDependencies(boolean ignore)voidsetInvocationCount(int invocationCount)voidsetInvocationTimeOut(long timeOut)voidsetRetryAnalyzer(java.lang.Class<? extends IRetryAnalyzer> c)voidsetSingleThreaded(boolean singleThreaded)voidsetSkipFailedInvocations(boolean skip)voidsetSuccessPercentage(int successPercentage)voidsetSuiteName(java.lang.String xmlSuite)voidsetTestName(java.lang.String xmlTest)voidsetThreadPoolSize(int threadPoolSize)booleanskipFailedInvocations()-
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:
getExpectedExceptionsin interfaceITestAnnotation- Returns:
- the expectedExceptions
-
setExpectedExceptions
public void setExpectedExceptions(java.lang.Class<?>[] expectedExceptions)
- Specified by:
setExpectedExceptionsin interfaceITestAnnotation- Parameters:
expectedExceptions- the expectedExceptions to set
-
getExpectedExceptionsMessageRegExp
public java.lang.String getExpectedExceptionsMessageRegExp()
- Specified by:
getExpectedExceptionsMessageRegExpin interfaceITestAnnotation
-
setExpectedExceptionsMessageRegExp
public void setExpectedExceptionsMessageRegExp(java.lang.String expectedExceptionsMessageRegExp)
- Specified by:
setExpectedExceptionsMessageRegExpin interfaceITestAnnotation
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun)
- Specified by:
setAlwaysRunin interfaceITestAnnotation
-
setDataProvider
public void setDataProvider(java.lang.String dataProvider)
- Specified by:
setDataProviderin interfaceIDataProvidable- Specified by:
setDataProviderin interfaceITestAnnotation
-
getDataProviderClass
public java.lang.Class<?> getDataProviderClass()
- Specified by:
getDataProviderClassin interfaceIDataProvidable- Specified by:
getDataProviderClassin interfaceITestAnnotation
-
setDataProviderClass
public void setDataProviderClass(java.lang.Class<?> dataProviderClass)
- Specified by:
setDataProviderClassin interfaceIDataProvidable- Specified by:
setDataProviderClassin interfaceITestAnnotation
-
setInvocationCount
public void setInvocationCount(int invocationCount)
- Specified by:
setInvocationCountin interfaceITestAnnotation
-
setSuccessPercentage
public void setSuccessPercentage(int successPercentage)
- Specified by:
setSuccessPercentagein interfaceITestAnnotation
-
getInvocationCount
public int getInvocationCount()
Description copied from interface:ITestAnnotationReturns the number of times this method should be invoked.- Specified by:
getInvocationCountin interfaceITestAnnotation- Returns:
- the number of times this method should be invoked.
-
invocationTimeOut
public long invocationTimeOut()
- Specified by:
invocationTimeOutin interfaceITestAnnotation
-
setInvocationTimeOut
public void setInvocationTimeOut(long timeOut)
- Specified by:
setInvocationTimeOutin interfaceITestAnnotation
-
getSuccessPercentage
public int getSuccessPercentage()
Description copied from interface:ITestAnnotationThe percentage of success expected from this method.- Specified by:
getSuccessPercentagein interfaceITestAnnotation- Returns:
- the value
-
getDataProvider
public java.lang.String getDataProvider()
- Specified by:
getDataProviderin interfaceIDataProvidable- Specified by:
getDataProviderin interfaceITestAnnotation
-
getAlwaysRun
public boolean getAlwaysRun()
Description copied from interface:ITestAnnotationIf 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:
getAlwaysRunin interfaceITestAnnotation- Returns:
- the value
-
getThreadPoolSize
public int getThreadPoolSize()
Description copied from interface:ITestAnnotationThe 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:
getThreadPoolSizein interfaceITestAnnotation- Returns:
- the value
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize)
- Specified by:
setThreadPoolSizein interfaceITestAnnotation
-
getSuiteName
public java.lang.String getSuiteName()
- Specified by:
getSuiteNamein interfaceITestAnnotation
-
setSuiteName
public void setSuiteName(java.lang.String xmlSuite)
- Specified by:
setSuiteNamein interfaceITestAnnotation
-
getTestName
public java.lang.String getTestName()
- Specified by:
getTestNamein interfaceITestAnnotation
-
setTestName
public void setTestName(java.lang.String xmlTest)
- Specified by:
setTestNamein interfaceITestAnnotation
-
getSingleThreaded
public boolean getSingleThreaded()
- Specified by:
getSingleThreadedin interfaceITestAnnotation
-
setSingleThreaded
public void setSingleThreaded(boolean singleThreaded)
- Specified by:
setSingleThreadedin interfaceITestAnnotation
-
getRetryAnalyzer
public IRetryAnalyzer getRetryAnalyzer()
- Specified by:
getRetryAnalyzerin interfaceITestAnnotation- Returns:
- The retry analyzer
-
setRetryAnalyzer
public void setRetryAnalyzer(java.lang.Class<? extends IRetryAnalyzer> c)
- Specified by:
setRetryAnalyzerin interfaceITestAnnotation
-
getRetryAnalyzerClass
public java.lang.Class<? extends IRetryAnalyzer> getRetryAnalyzerClass()
- Specified by:
getRetryAnalyzerClassin interfaceITestAnnotation
-
setSkipFailedInvocations
public void setSkipFailedInvocations(boolean skip)
- Specified by:
setSkipFailedInvocationsin interfaceITestAnnotation
-
skipFailedInvocations
public boolean skipFailedInvocations()
- Specified by:
skipFailedInvocationsin interfaceITestAnnotation
-
setIgnoreMissingDependencies
public void setIgnoreMissingDependencies(boolean ignore)
- Specified by:
setIgnoreMissingDependenciesin interfaceITestAnnotation
-
ignoreMissingDependencies
public boolean ignoreMissingDependencies()
- Specified by:
ignoreMissingDependenciesin interfaceITestAnnotation
-
getAttributes
public CustomAttribute[] getAttributes()
- Specified by:
getAttributesin interfaceITestAnnotation
-
setAttributes
public void setAttributes(CustomAttribute[] attributes)
- Specified by:
setAttributesin interfaceITestAnnotation
-
isRetryAnalyzerNotTestNGInjected
private static boolean isRetryAnalyzerNotTestNGInjected(java.lang.Class<? extends IRetryAnalyzer> c)
-
-