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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf set to true, this test method will always be run even if it depends on a method that failed.Class<?> Class<?>[]intReturns the number of times this method should be invoked.Class<? extends IRetryAnalyzer> booleanintThe percentage of success expected from this method.intThe size of the thread pool for this method.booleanlongvoidsetAlwaysRun(boolean alwaysRun) voidsetAttributes(CustomAttribute[] attributes) voidsetDataProvider(String dataProvider) voidsetDataProviderClass(Class<?> dataProviderClass) voidvoidsetExpectedExceptions(Class<?>[] expectedExceptions) voidsetExpectedExceptionsMessageRegExp(String expectedExceptionsMessageRegExp) voidsetIgnoreMissingDependencies(boolean ignore) voidsetInvocationCount(int invocationCount) voidsetInvocationTimeOut(long timeOut) voidsetRetryAnalyzer(Class<? extends IRetryAnalyzer> c) voidsetSingleThreaded(boolean singleThreaded) voidsetSkipFailedInvocations(boolean skip) voidsetSuccessPercentage(int successPercentage) voidsetSuiteName(String xmlSuite) voidsetTestName(String xmlTest) voidsetThreadPoolSize(int threadPoolSize) booleanMethods inherited from class TestOrConfiguration
getDependsOnGroups, getDependsOnMethods, getDescription, getEnabled, getGroups, getPriority, getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setEnabled, setGroups, setPriority, setTimeOutMethods inherited from class BaseAnnotation
getConstructor, getMethod, getTestClass, setConstructor, setMethod, setTestClassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IParameterizable
getEnabled, setEnabledMethods inherited from interface ITestAnnotation
getPriority, setPriorityMethods inherited from interface ITestOrConfiguration
getDependsOnGroups, getDependsOnMethods, getDescription, getGroups, getTimeOut, setDependsOnGroups, setDependsOnMethods, setDescription, setGroups, setTimeOut
-
Constructor Details
-
TestAnnotation
public TestAnnotation()
-
-
Method Details
-
getExpectedExceptions
- Specified by:
getExpectedExceptionsin interfaceITestAnnotation- Returns:
- the expectedExceptions
-
setExpectedExceptions
- Specified by:
setExpectedExceptionsin interfaceITestAnnotation- Parameters:
expectedExceptions- the expectedExceptions to set
-
getExpectedExceptionsMessageRegExp
- Specified by:
getExpectedExceptionsMessageRegExpin interfaceITestAnnotation
-
setExpectedExceptionsMessageRegExp
- Specified by:
setExpectedExceptionsMessageRegExpin interfaceITestAnnotation
-
setAlwaysRun
public void setAlwaysRun(boolean alwaysRun) - Specified by:
setAlwaysRunin interfaceITestAnnotation
-
setDataProvider
- Specified by:
setDataProviderin interfaceIDataProvidable- Specified by:
setDataProviderin interfaceITestAnnotation
-
getDataProviderClass
- Specified by:
getDataProviderClassin interfaceIDataProvidable- Specified by:
getDataProviderClassin interfaceITestAnnotation
-
setDataProviderClass
- Specified by:
setDataProviderClassin interfaceIDataProvidable- Specified by:
setDataProviderClassin interfaceITestAnnotation
-
getDataProviderDynamicClass
- Specified by:
getDataProviderDynamicClassin interfaceIDataProvidable- Specified by:
getDataProviderDynamicClassin interfaceITestAnnotation
-
setDataProviderDynamicClass
- Specified by:
setDataProviderDynamicClassin interfaceIDataProvidable- Specified by:
setDataProviderDynamicClassin 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
- 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
- Specified by:
getSuiteNamein interfaceITestAnnotation
-
setSuiteName
- Specified by:
setSuiteNamein interfaceITestAnnotation
-
getTestName
- Specified by:
getTestNamein interfaceITestAnnotation
-
setTestName
- Specified by:
setTestNamein interfaceITestAnnotation
-
getSingleThreaded
public boolean getSingleThreaded()- Specified by:
getSingleThreadedin interfaceITestAnnotation
-
setSingleThreaded
public void setSingleThreaded(boolean singleThreaded) - Specified by:
setSingleThreadedin interfaceITestAnnotation
-
setRetryAnalyzer
- Specified by:
setRetryAnalyzerin interfaceITestAnnotation
-
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
- Specified by:
getAttributesin interfaceITestAnnotation
-
setAttributes
- Specified by:
setAttributesin interfaceITestAnnotation
-