Top Description Fields Constructors Methods
org.testng.internal

public Class TestNGMethod

extends BaseTestMethod
Class Inheritance
Imports
java.lang.reflect.Method, java.util.Arrays, .Collections, .List, .Objects, org.testng.IDataProviderMethod, .ITestClass, .ITestNGMethod, .ITestObjectFactory, org.testng.annotations.CustomAttribute, .ITestAnnotation, org.testng.internal.annotations.AnnotationHelper, .IAnnotationFinder, org.testng.xml.XmlClass, .XmlInclude, .XmlTest

This class represents a test method.

Field Summary

Modifier and TypeField and Description
private IDataProviderMethod
private boolean
private CustomAttribute[]
private int
private int
private int
Inherited from org.testng.internal.BaseTestMethod:
m_afterGroupsm_annotationFinderm_beforeGroupsm_currentInvocationCountm_datem_groupsm_groupsDependedUponm_idm_methodm_methodClassm_methodsDependedUponm_objectFactorym_testClass

Constructor Summary

AccessConstructor and Description
public
TestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, XmlTest xmlTest, IObject.IdentifiableObject instance)

Constructs a TestNGMethod

private
TestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, boolean initialize, XmlTest xmlTest, IObject.IdentifiableObject instance)

Method Summary

Modifier and TypeMethod and Description
private boolean
public BaseTestMethod
clone()

Implements abstract org.testng.internal.BaseTestMethod.clone.

Implements org.testng.ITestNGMethod.clone.

Clones the current TestNGMethod and its @BeforeMethod and @AfterMethod methods.
private static ITestNGMethod[]
clone(ITestNGMethod[] sources)

private static boolean
private String
findDescription(ITestAnnotation testAnnotation, XmlTest xmlTest)

public CustomAttribute[]
public IDataProviderMethod
public int
public int
public int
private void
init(XmlTest xmlTest)

public boolean
public boolean
private boolean
public void
public void
setInvocationCount(int counter)

Overrides org.testng.internal.BaseTestMethod.setInvocationCount.

Implements org.testng.ITestNGMethod.setInvocationCount.

Sets the number of invocations for this method.
public void
setThreadPoolSize(int threadPoolSize)

Overrides org.testng.internal.BaseTestMethod.setThreadPoolSize.

Implements org.testng.ITestNGMethod.setThreadPoolSize.

Sets the number of threads on which this method should be invoked.
Inherited from org.testng.internal.BaseTestMethod:
addFailedInvocationNumberaddMethodDependedUponcanRunFromClassdownstreamDependenciesequalsfindMethodParametersgetAfterGroupsgetAnnotationFindergetBeforeGroupsgetConstructorOrMethodgetCurrentInvocationCountgetDategetDescriptiongetEnabledgetFactoryMethodParamsInfogetFailedInvocationNumbersgetGroupsgetGroupsDependedUpongetIdgetInstancegetInstanceHashCodesgetInstanceIdgetInterceptedPrioritygetInvocationNumbersgetInvocationTimegetInvocationTimeOutgetMethodNamegetMethodsDependedUpongetMissingGroupgetParameterInvocationCountgetParameterTypesgetPrioritygetQualifiedNamegetRealClassgetRetryAnalyzergetRetryAnalyzerClassgetSignaturegetSimpleNamegetStringArraygetTestClassgetTimeOutgetXmlTesthashCodehasMoreInvocationignoreMissingDependenciesincrementCurrentInvocationCountinitBeforeAfterGroupsinitGroupsisAfterClassConfigurationisAfterGroupsConfigurationisAfterMethodConfigurationisAfterSuiteConfigurationisAfterTestConfigurationisAlwaysRunisBeforeClassConfigurationisBeforeGroupsConfigurationisBeforeMethodConfigurationisBeforeSuiteConfigurationisBeforeTestConfigurationsetAlwaysRunsetDatesetDescriptionsetDownstreamDependenciessetEnabledsetGroupssetGroupsDependedUponsetIdsetIgnoreMissingDependenciessetInterceptedPrioritysetInvocationNumberssetInvocationTimeOutsetInvokedAtsetMethodsDependedUponsetMissingGroupsetMoreInvocationCheckersetParameterInvocationCountsetPrioritysetRetryAnalyzerClasssetSkipFailedInvocationssetTestClasssetTimeOutsetUpstreamDependenciessetXmlTestskipFailedInvocationsstringifytoStringupstreamDependencies

Field Detail

dataProviderMethodback to summary
private IDataProviderMethod dataProviderMethod
isDataDrivenback to summary
private boolean isDataDriven
m_attributesback to summary
private CustomAttribute[] m_attributes
m_invocationCountback to summary
private int m_invocationCount
m_successPercentageback to summary
private int m_successPercentage
m_threadPoolSizeback to summary
private int m_threadPoolSize

Constructor Detail

TestNGMethodback to summary
public TestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, XmlTest xmlTest, IObject.IdentifiableObject instance)

Constructs a TestNGMethod

TestNGMethodback to summary
private TestNGMethod(ITestObjectFactory objectFactory, Method method, IAnnotationFinder finder, boolean initialize, XmlTest xmlTest, IObject.IdentifiableObject instance)

Method Detail

classNameMatcherback to summary
private boolean classNameMatcher(XmlClass xmlClass)
cloneback to summary
public BaseTestMethod clone()

Implements abstract org.testng.internal.BaseTestMethod.clone.

Implements org.testng.ITestNGMethod.clone.

Clones the current TestNGMethod and its @BeforeMethod and @AfterMethod methods.

Returns:BaseTestMethod

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
See Also
org.testng.internal.BaseTestMethod#clone()
cloneback to summary
private static ITestNGMethod[] clone(ITestNGMethod[] sources)
doesTestAnnotationHaveADataProviderback to summary
private static boolean doesTestAnnotationHaveADataProvider(ITestAnnotation testAnnotation)
findDescriptionback to summary
private String findDescription(ITestAnnotation testAnnotation, XmlTest xmlTest)
getAttributesback to summary
public CustomAttribute[] getAttributes()

Overrides default org.testng.ITestNGMethod.getAttributes.

Returns:CustomAttribute[]

Doc from org.testng.ITestNGMethod.getAttributes.

- An array of CustomAttribute that represents the custom attributes associated with a test.

Annotations
@Override
getDataProviderMethodback to summary
public IDataProviderMethod getDataProviderMethod()

Overrides default org.testng.ITestNGMethod.getDataProviderMethod.

Returns:IDataProviderMethod

Doc from org.testng.ITestNGMethod.getDataProviderMethod.

- An IDataProviderMethod for a data provider powered test method and null otherwise.

Annotations
@Override
getInvocationCountback to summary
public int getInvocationCount()

Overrides org.testng.internal.BaseTestMethod.getInvocationCount.

Implements org.testng.ITestNGMethod.getInvocationCount.

Returns:int

Doc from org.testng.internal.BaseTestMethod.getInvocationCount.

the number of times this method needs to be invoked.

Annotations
@Override
getSuccessPercentageback to summary
public int getSuccessPercentage()

Overrides org.testng.internal.BaseTestMethod.getSuccessPercentage.

Implements org.testng.ITestNGMethod.getSuccessPercentage.

Doc from org.testng.internal.BaseTestMethod.getSuccessPercentage.

Default value for successPercentage.

Returns:int

Doc from org.testng.ITestNGMethod.getSuccessPercentage.

the success percentage for this method (between 0 and 100).

Annotations
@Override
getThreadPoolSizeback to summary
public int getThreadPoolSize()

Overrides org.testng.internal.BaseTestMethod.getThreadPoolSize.

Implements org.testng.ITestNGMethod.getThreadPoolSize.

Returns:int

Doc from org.testng.ITestNGMethod.getThreadPoolSize.

the number of threads to be used when invoking the method on parallel

Annotations
@Override
initback to summary
private void init(XmlTest xmlTest)
isDataDrivenback to summary
public boolean isDataDriven()

Overrides default org.testng.ITestNGMethod.isDataDriven.

Annotations
@Override
isTestback to summary
public boolean isTest()

Overrides org.testng.internal.BaseTestMethod.isTest.

Implements org.testng.ITestNGMethod.isTest.

Returns:boolean

Doc from org.testng.ITestNGMethod.isTest.

true if this method was annotated with @Test

Annotations
@Override
methodNameMatcherback to summary
private boolean methodNameMatcher(XmlInclude xmlInclude)
setDataProviderMethodback to summary
public void setDataProviderMethod(IDataProviderMethod dataProviderMethod)
setInvocationCountback to summary
public void setInvocationCount(int counter)

Overrides org.testng.internal.BaseTestMethod.setInvocationCount.

Implements org.testng.ITestNGMethod.setInvocationCount.

Sets the number of invocations for this method.

Annotations
@Override
setThreadPoolSizeback to summary
public void setThreadPoolSize(int threadPoolSize)

Overrides org.testng.internal.BaseTestMethod.setThreadPoolSize.

Implements org.testng.ITestNGMethod.setThreadPoolSize.

Sets the number of threads on which this method should be invoked.

Annotations
@Override