Package org.testng.internal
Class TestNGMethod
- java.lang.Object
-
- org.testng.internal.BaseTestMethod
-
- org.testng.internal.TestNGMethod
-
- All Implemented Interfaces:
Cloneable
,ITestNGMethod
public class TestNGMethod extends BaseTestMethod
This class represents a test method.
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<ITestNGMethod>
SORT_BY_CLASS
Sorts ITestNGMethod by Class name.-
Fields inherited from class org.testng.internal.BaseTestMethod
DATE_COMPARATOR, m_afterGroups, m_annotationFinder, m_beforeGroups, m_currentInvocationCount, m_date, m_groups, m_groupsDependedUpon, m_id, m_method, m_methodClass, m_methodsDependedUpon, m_testClass
-
-
Constructor Summary
Constructors Constructor Description TestNGMethod(Method method, IAnnotationFinder finder, XmlTest xmlTest, Object instance)
Constructs aTestNGMethod
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseTestMethod
clone()
Clones the currentTestNGMethod
and its @BeforeMethod and @AfterMethod methods.int
getInvocationCount()
int
getSuccessPercentage()
Default value for successPercentage.int
getThreadPoolSize()
boolean
isTest()
void
setInvocationCount(int counter)
Sets the number of invocations for this method.void
setThreadPoolSize(int threadPoolSize)
Sets the number of threads on which this method should be invoked.-
Methods inherited from class org.testng.internal.BaseTestMethod
addFailedInvocationNumber, addMethodDependedUpon, canRunFromClass, equals, findMethodParameters, getAfterGroups, getAnnotationFinder, getBeforeGroups, getConstructorOrMethod, getCurrentInvocationCount, getDate, getDescription, getEnabled, getFailedInvocationNumbers, getGroups, getGroupsDependedUpon, getIClass, getId, getInstance, getInstanceHashCodes, getInstances, getInvocationNumbers, getInvocationTimeOut, getMethod, getMethodName, getMethodsDependedUpon, getMissingGroup, getParameterInvocationCount, getPriority, getQualifiedName, getRealClass, getRetryAnalyzer, getSignature, getSimpleName, getStringArray, getTestClass, getTimeOut, getTotalInvocationCount, getXmlTest, hashCode, hasMoreInvocation, ignoreMissingDependencies, incrementCurrentInvocationCount, initBeforeAfterGroups, initGroups, isAfterClassConfiguration, isAfterGroupsConfiguration, isAfterMethodConfiguration, isAfterSuiteConfiguration, isAfterTestConfiguration, isAlwaysRun, isBeforeClassConfiguration, isBeforeGroupsConfiguration, isBeforeMethodConfiguration, isBeforeSuiteConfiguration, isBeforeTestConfiguration, setAlwaysRun, setDate, setDescription, setEnabled, setGroups, setGroupsDependedUpon, setId, setIgnoreMissingDependencies, setInvocationNumbers, setInvocationTimeOut, setMethodsDependedUpon, setMissingGroup, setMoreInvocationChecker, setParameterInvocationCount, setPriority, setRetryAnalyzer, setSkipFailedInvocations, setTestClass, setTimeOut, setXmlTest, skipFailedInvocations, toString
-
-
-
-
Field Detail
-
SORT_BY_CLASS
public static final Comparator<ITestNGMethod> SORT_BY_CLASS
Sorts ITestNGMethod by Class name.
-
-
Constructor Detail
-
TestNGMethod
public TestNGMethod(Method method, IAnnotationFinder finder, XmlTest xmlTest, Object instance)
Constructs aTestNGMethod
- Parameters:
method
-finder
-
-
-
Method Detail
-
getInvocationCount
public int getInvocationCount()
- Specified by:
getInvocationCount
in interfaceITestNGMethod
- Overrides:
getInvocationCount
in classBaseTestMethod
- Returns:
- the number of times this method needs to be invoked.
-
getSuccessPercentage
public int getSuccessPercentage()
Default value for successPercentage.- Specified by:
getSuccessPercentage
in interfaceITestNGMethod
- Overrides:
getSuccessPercentage
in classBaseTestMethod
- Returns:
- the success percentage for this method (between 0 and 100).
-
isTest
public boolean isTest()
- Specified by:
isTest
in interfaceITestNGMethod
- Overrides:
isTest
in classBaseTestMethod
- Returns:
- true if this method was annotated with @Test
-
getThreadPoolSize
public int getThreadPoolSize()
- Specified by:
getThreadPoolSize
in interfaceITestNGMethod
- Overrides:
getThreadPoolSize
in 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:
setThreadPoolSize
in interfaceITestNGMethod
- Overrides:
setThreadPoolSize
in classBaseTestMethod
-
setInvocationCount
public void setInvocationCount(int counter)
Sets the number of invocations for this method.- Specified by:
setInvocationCount
in interfaceITestNGMethod
- Overrides:
setInvocationCount
in classBaseTestMethod
-
clone
public BaseTestMethod clone()
Clones the currentTestNGMethod
and its @BeforeMethod and @AfterMethod methods.- Specified by:
clone
in interfaceITestNGMethod
- Specified by:
clone
in classBaseTestMethod
- See Also:
BaseTestMethod.clone()
-
-