Class TestNGMethod
java.lang.Object
org.testng.internal.BaseTestMethod
org.testng.internal.TestNGMethod
- All Implemented Interfaces:
Cloneable, IInstanceIdentity, IInvocationStatus, ITestNGMethod
This class represents a test method.
-
Field Summary
Fields inherited from class BaseTestMethod
m_afterGroups, m_annotationFinder, m_beforeGroups, m_currentInvocationCount, m_date, m_groups, m_groupsDependedUpon, m_id, m_method, m_methodClass, m_methodsDependedUpon, m_objectFactory, m_testClass -
Constructor Summary
ConstructorsConstructorDescriptionTestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, XmlTest xmlTest, IObject.IdentifiableObject instance) Constructs aTestNGMethod -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones the currentTestNGMethodand its @BeforeMethod and @AfterMethod methods.intintDefault value for successPercentage.intbooleanbooleanisTest()voidsetDataProviderMethod(IDataProviderMethod dataProviderMethod) voidsetInvocationCount(int counter) Sets the number of invocations for this method.voidsetThreadPoolSize(int threadPoolSize) Sets the number of threads on which this method should be invoked.Methods inherited from class BaseTestMethod
addFailedInvocationNumber, addMethodDependedUpon, canRunFromClass, downstreamDependencies, equals, findMethodParameters, getAfterGroups, getAnnotationFinder, getBeforeGroups, getConstructorOrMethod, getCurrentInvocationCount, getDate, getDescription, getEnabled, getFactoryMethodParamsInfo, getFailedInvocationNumbers, getGroups, getGroupsDependedUpon, getId, getInstance, getInstanceHashCodes, getInstanceId, getInterceptedPriority, getInvocationNumbers, getInvocationTime, getInvocationTimeOut, getMethodName, getMethodsDependedUpon, getMissingGroup, getParameterInvocationCount, getParameterTypes, getPriority, getQualifiedName, getRealClass, getRetryAnalyzer, getRetryAnalyzerClass, getSignature, getSimpleName, getStringArray, getTestClass, getTimeOut, getXmlTest, hashCode, hasMoreInvocation, ignoreMissingDependencies, incrementCurrentInvocationCount, initBeforeAfterGroups, initGroups, isAfterClassConfiguration, isAfterGroupsConfiguration, isAfterMethodConfiguration, isAfterSuiteConfiguration, isAfterTestConfiguration, isAlwaysRun, isBeforeClassConfiguration, isBeforeGroupsConfiguration, isBeforeMethodConfiguration, isBeforeSuiteConfiguration, isBeforeTestConfiguration, setAlwaysRun, setDate, setDescription, setDownstreamDependencies, setEnabled, setGroups, setGroupsDependedUpon, setId, setIgnoreMissingDependencies, setInterceptedPriority, setInvocationNumbers, setInvocationTimeOut, setInvokedAt, setMethodsDependedUpon, setMissingGroup, setMoreInvocationChecker, setParameterInvocationCount, setPriority, setRetryAnalyzerClass, setSkipFailedInvocations, setTestClass, setTimeOut, setUpstreamDependencies, setXmlTest, skipFailedInvocations, toString, upstreamDependenciesMethods inherited from interface ITestNGMethod
hasAfterGroupsConfiguration, hasBeforeGroupsConfiguration, isIgnoreFailure
-
Constructor Details
-
TestNGMethod
public TestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, XmlTest xmlTest, IObject.IdentifiableObject instance) Constructs aTestNGMethod
-
-
Method Details
-
getInvocationCount
public int getInvocationCount()- Specified by:
getInvocationCountin interfaceITestNGMethod- Overrides:
getInvocationCountin classBaseTestMethod- Returns:
- the number of times this method needs to be invoked.
-
getSuccessPercentage
public int getSuccessPercentage()Default value for successPercentage.- Specified by:
getSuccessPercentagein interfaceITestNGMethod- Overrides:
getSuccessPercentagein classBaseTestMethod- Returns:
- the success percentage for this method (between 0 and 100).
-
isTest
public boolean isTest()- Specified by:
isTestin interfaceITestNGMethod- Overrides:
isTestin classBaseTestMethod- Returns:
- true if this method was annotated with @Test
-
getThreadPoolSize
public int getThreadPoolSize()- Specified by:
getThreadPoolSizein interfaceITestNGMethod- Overrides:
getThreadPoolSizein classBaseTestMethod- Returns:
- the number of threads to be used when invoking the method on parallel
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize) Sets the number of threads on which this method should be invoked.- Specified by:
setThreadPoolSizein interfaceITestNGMethod- Overrides:
setThreadPoolSizein classBaseTestMethod
-
setInvocationCount
public void setInvocationCount(int counter) Sets the number of invocations for this method.- Specified by:
setInvocationCountin interfaceITestNGMethod- Overrides:
setInvocationCountin classBaseTestMethod
-
clone
Clones the currentTestNGMethodand its @BeforeMethod and @AfterMethod methods.- Specified by:
clonein interfaceITestNGMethod- Specified by:
clonein classBaseTestMethod- See Also:
-
isDataDriven
public boolean isDataDriven() -
getAttributes
- Returns:
- - An array of
CustomAttributethat represents the custom attributes associated with a test.
-
getDataProviderMethod
- Returns:
- - An
IDataProviderMethodfor a data provider powered test method andnullotherwise.
-
setDataProviderMethod
-