org.testng.internal
Class TestNGMethod

java.lang.Object
  extended by org.testng.internal.BaseTestMethod
      extended by org.testng.internal.TestNGMethod
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, ITestNGMethod

public class TestNGMethod
extends BaseTestMethod

This class represents a test method.

Author:
Cedric Beust, May 3, 2004, Alexandru Popescu
See Also:
Serialized Form

Field Summary
static java.util.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
TestNGMethod(java.lang.reflect.Method method, IAnnotationFinder finder)
          Constructs a TestNGMethod
 
Method Summary
 TestNGMethod clone()
          Clones the current TestNGMethod and its @BeforeMethod and @AfterMethod methods.
 int getInvocationCount()
          
 int getSuccessPercentage()
           Default value for successPercentage.
 int getThreadPoolSize()
          
 long getTimeOut()
          
 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
addMethodDependedUpon, canRunFromClass, compareTo, equals, getAfterGroups, getAnnotationFinder, getBeforeGroups, getCurrentInvocationCount, getDate, getDescription, getGroups, getGroupsDependedUpon, getIClass, getId, getInstanceHashCodes, getInstances, getMethod, getMethodName, getMethodsDependedUpon, getMissingGroup, getParameterInvocationCount, getRealClass, getRetryAnalyzer, getSignature, getStringArray, getTestClass, hashCode, incrementCurrentInvocationCount, initGroups, isAfterClassConfiguration, isAfterGroupsConfiguration, isAfterMethodConfiguration, isAfterSuiteConfiguration, isAfterTestConfiguration, isAlwaysRun, isBeforeClassConfiguration, isBeforeGroupsConfiguration, isBeforeMethodConfiguration, isBeforeSuiteConfiguration, isBeforeTestConfiguration, setAlwaysRun, setDate, setDescription, setGroups, setGroupsDependedUpon, setId, setMethodsDependedUpon, setMissingGroup, setParameterInvocationCount, setRetryAnalyzer, setSkipFailedInvocations, setTestClass, skipFailedInvocations, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SORT_BY_CLASS

public static final java.util.Comparator<ITestNGMethod> SORT_BY_CLASS
Sorts ITestNGMethod by Class name.

Constructor Detail

TestNGMethod

public TestNGMethod(java.lang.reflect.Method method,
                    IAnnotationFinder finder)
Constructs a TestNGMethod

Parameters:
method -
finder -
Method Detail

getTimeOut

public long getTimeOut()

Specified by:
getTimeOut in interface ITestNGMethod
Overrides:
getTimeOut in class BaseTestMethod
Returns:
The timeout in milliseconds.

getInvocationCount

public int getInvocationCount()

Specified by:
getInvocationCount in interface ITestNGMethod
Overrides:
getInvocationCount in class BaseTestMethod
Returns:
the number of times this method needs to be invoked.

getSuccessPercentage

public int getSuccessPercentage()
Default value for successPercentage.

Specified by:
getSuccessPercentage in interface ITestNGMethod
Overrides:
getSuccessPercentage in class BaseTestMethod
Returns:
the success percentage for this method (between 0 and 100).

isTest

public boolean isTest()

Specified by:
isTest in interface ITestNGMethod
Overrides:
isTest in class BaseTestMethod
Returns:
true if this method was annotated with @Test

getThreadPoolSize

public int getThreadPoolSize()

Specified by:
getThreadPoolSize in interface ITestNGMethod
Overrides:
getThreadPoolSize in class BaseTestMethod
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 interface ITestNGMethod
Overrides:
setThreadPoolSize in class BaseTestMethod

setInvocationCount

public void setInvocationCount(int counter)
Sets the number of invocations for this method.

Specified by:
setInvocationCount in interface ITestNGMethod
Overrides:
setInvocationCount in class BaseTestMethod

clone

public TestNGMethod clone()
Clones the current TestNGMethod and its @BeforeMethod and @AfterMethod methods.

Specified by:
clone in interface ITestNGMethod
Specified by:
clone in class BaseTestMethod
See Also:
BaseTestMethod.clone()


Copyright © 2010. All Rights Reserved.