org.testng
Interface ITestNGMethod

All Superinterfaces:
Cloneable, Comparable, Serializable
All Known Implementing Classes:
org.testng.internal.BaseTestMethod, JUnit3TestMethod, JUnit4TestMethod, JUnitTestMethod

public interface ITestNGMethod
extends Comparable, Serializable, Cloneable

Describes a TestNG annotated method and the instance on which it will be invoked. This interface is not meant to be implemented by users.

Author:
Cedric Beust, May 3, 2004


Method Summary
 voidaddFailedInvocationNumber(int number)
          The list of invocation numbers that failed, which is only applicable for methods that have a data provider.
 voidaddMethodDependedUpon(String methodName)
           
 booleancanRunFromClass(IClass testClass)
          Returns if this ITestNGMethod can be invoked from within IClass.
 ITestNGMethodclone()
           
 Map<String,String>findMethodParameters(XmlTest test)
           
 String[]getAfterGroups()
           
 String[]getBeforeGroups()
          Before and After groups
 org.testng.internal.ConstructorOrMethodgetConstructorOrMethod()
           
 intgetCurrentInvocationCount()
           
 longgetDate()
           
 StringgetDescription()
           
 booleangetEnabled()
           
 List<Integer>getFailedInvocationNumbers()
           
 String[]getGroups()
           
 String[]getGroupsDependedUpon()
           
 StringgetId()
           
 ObjectgetInstance()
           
 long[]getInstanceHashCodes()
          Needed for serialization.
 Object[]getInstances()
          Deprecated. Use getInstance().
 intgetInvocationCount()
           
 List<Integer>getInvocationNumbers()
          Which invocation numbers of this method should be used (only applicable if it uses a data provider).
 longgetInvocationTimeOut()
          The time under which all invocationCount methods need to complete by.
 MethodgetMethod()
          Deprecated. This method is deprecated and can now return null. Use getConstructorOrMethod() instead.
 StringgetMethodName()
          Returns the method name.
 String[]getMethodsDependedUpon()
           
 StringgetMissingGroup()
          If a group was not found.
 intgetParameterInvocationCount()
           
 intgetPriority()
          The scheduling priority.
 ClassgetRealClass()
           
 IRetryAnalyzergetRetryAnalyzer()
           
 intgetSuccessPercentage()
           
 ITestClassgetTestClass()
           
 intgetThreadPoolSize()
           
 longgetTimeOut()
           
 XmlTestgetXmlTest()
           
 booleanignoreMissingDependencies()
           
 voidincrementCurrentInvocationCount()
           
 booleanisAfterClassConfiguration()
           
 booleanisAfterGroupsConfiguration()
           
 booleanisAfterMethodConfiguration()
           
 booleanisAfterSuiteConfiguration()
           
 booleanisAfterTestConfiguration()
           
 booleanisAlwaysRun()
           
 booleanisBeforeClassConfiguration()
           
 booleanisBeforeGroupsConfiguration()
           
 booleanisBeforeMethodConfiguration()
           
 booleanisBeforeSuiteConfiguration()
           
 booleanisBeforeTestConfiguration()
           
 booleanisTest()
           
 voidsetDate(long date)
           
 voidsetId(String id)
           
 voidsetIgnoreMissingDependencies(boolean ignore)
           
 voidsetInvocationCount(int count)
           
 voidsetInvocationNumbers(List<Integer> numbers)
           
 voidsetMissingGroup(String group)
           
 voidsetParameterInvocationCount(int n)
           
 voidsetPriority(int priority)
           
 voidsetRetryAnalyzer(IRetryAnalyzer retryAnalyzer)
           
 voidsetSkipFailedInvocations(boolean skip)
           
 voidsetTestClass(ITestClass cls)
          Sets the test class having this method.
 voidsetThreadPoolSize(int threadPoolSize)
           
 voidsetTimeOut(long timeOut)
           
 booleanskipFailedInvocations()
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getRealClass

Class getRealClass()
Returns:
The real class on which this method was declared (can be different from getMethod().getDeclaringClass() if the test method was defined in a superclass).

getTestClass

ITestClass getTestClass()

setTestClass

void setTestClass(ITestClass cls)
Sets the test class having this method. This is not necessarily the declaring class.

Parameters:
cls - The test class having this method.

getMethod

@DeprecatedMethod getMethod()
Deprecated. This method is deprecated and can now return null. Use getConstructorOrMethod() instead.

Returns:
the corresponding Java test method.

getMethodName

String getMethodName()
Returns the method name. This is needed for serialization because methods are not Serializable.

Returns:
the method name.

getInstances

@DeprecatedObject[] getInstances()
Deprecated. Use getInstance().

Returns:
All the instances the methods will be invoked upon. This will typically be an array of one object in the absence of an @Factory annotation.

getInstance

Object getInstance()

getInstanceHashCodes

long[] getInstanceHashCodes()
Needed for serialization.


getGroups

String[] getGroups()
Returns:
The groups this method belongs to, possibly added to the groups declared on the class.

getGroupsDependedUpon

String[] getGroupsDependedUpon()
Returns:
The groups this method depends on, possibly added to the groups declared on the class.

getMissingGroup

String getMissingGroup()
If a group was not found.


setMissingGroup

void setMissingGroup(String group)

getBeforeGroups

String[] getBeforeGroups()
Before and After groups


getAfterGroups

String[] getAfterGroups()

getMethodsDependedUpon

String[] getMethodsDependedUpon()
Returns:
The methods this method depends on, possibly added to the methods declared on the class.

addMethodDependedUpon

void addMethodDependedUpon(String methodName)

isTest

boolean isTest()
Returns:
true if this method was annotated with @Test

isBeforeMethodConfiguration

boolean isBeforeMethodConfiguration()
Returns:
true if this method was annotated with @Configuration and beforeTestMethod = true

isAfterMethodConfiguration

boolean isAfterMethodConfiguration()
Returns:
true if this method was annotated with @Configuration and beforeTestMethod = false

isBeforeClassConfiguration

boolean isBeforeClassConfiguration()
Returns:
true if this method was annotated with @Configuration and beforeClassMethod = true

isAfterClassConfiguration

boolean isAfterClassConfiguration()
Returns:
true if this method was annotated with @Configuration and beforeClassMethod = false

isBeforeSuiteConfiguration

boolean isBeforeSuiteConfiguration()
Returns:
true if this method was annotated with @Configuration and beforeSuite = true

isAfterSuiteConfiguration

boolean isAfterSuiteConfiguration()
Returns:
true if this method was annotated with @Configuration and afterSuite = true

isBeforeTestConfiguration

boolean isBeforeTestConfiguration()
Returns:
true if this method is a @BeforeTest (@Configuration beforeTest=true)

isAfterTestConfiguration

boolean isAfterTestConfiguration()
Returns:
true if this method is an @AfterTest (@Configuration afterTest=true)

isBeforeGroupsConfiguration

boolean isBeforeGroupsConfiguration()

isAfterGroupsConfiguration

boolean isAfterGroupsConfiguration()

getTimeOut

long getTimeOut()
Returns:
The timeout in milliseconds.

setTimeOut

void setTimeOut(long timeOut)

getInvocationCount

int getInvocationCount()
Returns:
the number of times this method needs to be invoked.

setInvocationCount

void setInvocationCount(int count)

getSuccessPercentage

int getSuccessPercentage()
Returns:
the success percentage for this method (between 0 and 100).

getId

String getId()
Returns:
The id of the thread this method was run in.

setId

void setId(String id)

getDate

long getDate()

setDate

void setDate(long date)

canRunFromClass

boolean canRunFromClass(IClass testClass)
Returns if this ITestNGMethod can be invoked from within IClass.


isAlwaysRun

boolean isAlwaysRun()
Returns:
true if this method is alwaysRun=true

getThreadPoolSize

int getThreadPoolSize()
Returns:
the number of threads to be used when invoking the method on parallel

setThreadPoolSize

void setThreadPoolSize(int threadPoolSize)

getEnabled

boolean getEnabled()

getDescription

String getDescription()

incrementCurrentInvocationCount

void incrementCurrentInvocationCount()

getCurrentInvocationCount

int getCurrentInvocationCount()

setParameterInvocationCount

void setParameterInvocationCount(int n)

getParameterInvocationCount

int getParameterInvocationCount()

clone

ITestNGMethod clone()

getRetryAnalyzer

IRetryAnalyzer getRetryAnalyzer()

setRetryAnalyzer

void setRetryAnalyzer(IRetryAnalyzer retryAnalyzer)

skipFailedInvocations

boolean skipFailedInvocations()

setSkipFailedInvocations

void setSkipFailedInvocations(boolean skip)

getInvocationTimeOut

long getInvocationTimeOut()
The time under which all invocationCount methods need to complete by.


ignoreMissingDependencies

boolean ignoreMissingDependencies()

setIgnoreMissingDependencies

void setIgnoreMissingDependencies(boolean ignore)

getInvocationNumbers

List<Integer> getInvocationNumbers()
Which invocation numbers of this method should be used (only applicable if it uses a data provider). If this value is an empty list, use all the values returned from the data provider. These values are read from the XML file in the tag.


setInvocationNumbers

void setInvocationNumbers(List<Integer> numbers)

addFailedInvocationNumber

void addFailedInvocationNumber(int number)
The list of invocation numbers that failed, which is only applicable for methods that have a data provider.


getFailedInvocationNumbers

List<Integer> getFailedInvocationNumbers()

getPriority

int getPriority()
The scheduling priority. Lower priorities get scheduled first.


setPriority

void setPriority(int priority)

getXmlTest

XmlTest getXmlTest()
Returns:
the XmlTest this method belongs to.

getConstructorOrMethod

org.testng.internal.ConstructorOrMethod getConstructorOrMethod()

findMethodParameters

Map<String,String> findMethodParameters(XmlTest test)
Parameters:
test -
Returns:
the parameters found in the include tag, if any


Copyright © 2012. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14