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 Created on Dec 20, 2005- Author:
- Cedric Beust
-
-
Constructor Summary
Constructors Constructor Description TestAnnotation()
-
Method Summary
All 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.String
getDataProvider()
Class<?>
getDataProviderClass()
Class<?>[]
getExpectedExceptions()
String
getExpectedExceptionsMessageRegExp()
int
getInvocationCount()
Returns the number of times this method should be invoked.IRetryAnalyzer
getRetryAnalyzer()
boolean
getSequential()
boolean
getSingleThreaded()
int
getSuccessPercentage()
The percentage of success expected from this method.String
getSuiteName()
String
getTestName()
int
getThreadPoolSize()
The size of the thread pool for this method.boolean
ignoreMissingDependencies()
long
invocationTimeOut()
void
setAlwaysRun(boolean alwaysRun)
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<?> c)
void
setSequential(boolean sequential)
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
skipFailedInvocations()
-
Methods inherited from class org.testng.internal.annotations.TestOrConfiguration
getDependsOnGroups, getDependsOnMethods, getDescription, getEnabled, getGroups, getParameters, getPriority, getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setEnabled, setGroups, setParameters, 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, getParameters, 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
-
-
-
-
Method Detail
-
getExpectedExceptions
public Class<?>[] getExpectedExceptions()
- Specified by:
getExpectedExceptions
in interfaceITestAnnotation
- Returns:
- the expectedExceptions
-
setExpectedExceptions
public void setExpectedExceptions(Class<?>[] expectedExceptions)
- Specified by:
setExpectedExceptions
in interfaceITestAnnotation
- Parameters:
expectedExceptions
- the expectedExceptions to set
-
getExpectedExceptionsMessageRegExp
public String getExpectedExceptionsMessageRegExp()
- Specified by:
getExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setExpectedExceptionsMessageRegExp
public void setExpectedExceptionsMessageRegExp(String expectedExceptionsMessageRegExp)
- Specified by:
setExpectedExceptionsMessageRegExp
in interfaceITestAnnotation
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun)
- Specified by:
setAlwaysRun
in interfaceITestAnnotation
-
setDataProvider
public void setDataProvider(String dataProvider)
- Specified by:
setDataProvider
in interfaceIDataProvidable
- Specified by:
setDataProvider
in interfaceITestAnnotation
-
getDataProviderClass
public Class<?> getDataProviderClass()
- Specified by:
getDataProviderClass
in interfaceIDataProvidable
- Specified by:
getDataProviderClass
in interfaceITestAnnotation
-
setDataProviderClass
public void setDataProviderClass(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
-
getDataProvider
public 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
-
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
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize)
- Specified by:
setThreadPoolSize
in interfaceITestAnnotation
-
getSuiteName
public String getSuiteName()
- Specified by:
getSuiteName
in interfaceITestAnnotation
-
setSuiteName
public void setSuiteName(String xmlSuite)
- Specified by:
setSuiteName
in interfaceITestAnnotation
-
getTestName
public String getTestName()
- Specified by:
getTestName
in interfaceITestAnnotation
-
setTestName
public void setTestName(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
-
getSequential
public boolean getSequential()
- Specified by:
getSequential
in interfaceITestAnnotation
-
setSequential
public void setSequential(boolean sequential)
- Specified by:
setSequential
in interfaceITestAnnotation
-
getRetryAnalyzer
public IRetryAnalyzer getRetryAnalyzer()
- Specified by:
getRetryAnalyzer
in interfaceITestAnnotation
-
setRetryAnalyzer
public void setRetryAnalyzer(Class<?> c)
- Specified by:
setRetryAnalyzer
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
-
-