public abstract class BaseTestMethod extends Object implements ITestNGMethod
Modifier and Type | Field and Description |
---|---|
static Comparator<?> |
DATE_COMPARATOR
Compares two ITestNGMethod by date.
|
protected String[] |
m_afterGroups |
protected IAnnotationFinder |
m_annotationFinder |
protected String[] |
m_beforeGroups |
protected AtomicInteger |
m_currentInvocationCount |
protected long |
m_date |
protected String[] |
m_groups |
protected String[] |
m_groupsDependedUpon |
protected String |
m_id |
protected ConstructorOrMethod |
m_method |
protected Class<?> |
m_methodClass |
protected String[] |
m_methodsDependedUpon |
protected ITestClass |
m_testClass
The test class on which the test method was found.
|
Constructor and Description |
---|
BaseTestMethod(String methodName,
ConstructorOrMethod com,
IAnnotationFinder annotationFinder,
Object instance) |
BaseTestMethod(String methodName,
Method method,
IAnnotationFinder annotationFinder,
Object instance)
Constructs a
BaseTestMethod TODO cquezel JavaDoc. |
Modifier and Type | Method and Description |
---|---|
void |
addFailedInvocationNumber(int number)
The list of invocation numbers that failed, which is only applicable for
methods that have a data provider.
|
void |
addMethodDependedUpon(String method) |
boolean |
canRunFromClass(IClass testClass)
Returns if this ITestNGMethod can be invoked from within IClass.
|
abstract ITestNGMethod |
clone() |
boolean |
equals(Object obj)
Compares two BaseTestMethod using the test class then the associated
Java Method.
|
Map<String,String> |
findMethodParameters(XmlTest test) |
String[] |
getAfterGroups() |
protected IAnnotationFinder |
getAnnotationFinder() |
String[] |
getBeforeGroups()
Before and After groups
|
ConstructorOrMethod |
getConstructorOrMethod() |
int |
getCurrentInvocationCount() |
long |
getDate() |
String |
getDescription() |
boolean |
getEnabled() |
List<Integer> |
getFailedInvocationNumbers() |
String[] |
getGroups() |
String[] |
getGroupsDependedUpon() |
protected IClass |
getIClass() |
String |
getId() |
Object |
getInstance() |
long[] |
getInstanceHashCodes()
Needed for serialization.
|
Object[] |
getInstances() |
int |
getInvocationCount() |
List<Integer> |
getInvocationNumbers()
Which invocation numbers of this method should be used (only applicable
if it uses a data provider).
|
long |
getInvocationTimeOut()
The time under which all invocationCount methods need to complete by.
|
Method |
getMethod() |
String |
getMethodName()
Returns the method name.
|
String[] |
getMethodsDependedUpon() |
String |
getMissingGroup()
If a group was not found.
|
int |
getParameterInvocationCount() |
int |
getPriority()
The scheduling priority.
|
String |
getQualifiedName()
getRealClass().getName() + "." + getMethodName()
|
Class<?> |
getRealClass() |
IRetryAnalyzer |
getRetryAnalyzer() |
protected String |
getSignature() |
String |
getSimpleName() |
protected String[] |
getStringArray(String[] methodArray,
String[] classArray) |
int |
getSuccessPercentage()
Default value for successPercentage.
|
ITestClass |
getTestClass() |
int |
getThreadPoolSize() |
long |
getTimeOut() |
int |
getTotalInvocationCount() |
XmlTest |
getXmlTest() |
int |
hashCode()
This implementation returns the associated Java Method's hash code.
|
boolean |
hasMoreInvocation() |
boolean |
ignoreMissingDependencies() |
void |
incrementCurrentInvocationCount() |
protected void |
initBeforeAfterGroups(Class<? extends ITestOrConfiguration> annotationClass,
String[] groups) |
protected void |
initGroups(Class<? extends ITestOrConfiguration> annotationClass) |
boolean |
isAfterClassConfiguration() |
boolean |
isAfterGroupsConfiguration() |
boolean |
isAfterMethodConfiguration() |
boolean |
isAfterSuiteConfiguration() |
boolean |
isAfterTestConfiguration() |
boolean |
isAlwaysRun() |
boolean |
isBeforeClassConfiguration() |
boolean |
isBeforeGroupsConfiguration() |
boolean |
isBeforeMethodConfiguration() |
boolean |
isBeforeSuiteConfiguration() |
boolean |
isBeforeTestConfiguration() |
boolean |
isTest() |
protected void |
setAlwaysRun(boolean alwaysRun)
TODO cquezel JavaDoc.
|
void |
setDate(long date) |
void |
setDescription(String description) |
void |
setEnabled(boolean enabled) |
protected void |
setGroups(String[] groups) |
protected void |
setGroupsDependedUpon(String[] groups,
Collection<String> xmlGroupDependencies) |
void |
setId(String id) |
void |
setIgnoreMissingDependencies(boolean i) |
void |
setInvocationCount(int counter)
No-op.
|
void |
setInvocationNumbers(List<Integer> numbers) |
void |
setInvocationTimeOut(long timeOut) |
protected void |
setMethodsDependedUpon(String[] methods) |
void |
setMissingGroup(String group) |
void |
setMoreInvocationChecker(Callable<Boolean> moreInvocationChecker) |
void |
setParameterInvocationCount(int n) |
void |
setPriority(int priority) |
void |
setRetryAnalyzer(IRetryAnalyzer retryAnalyzer) |
void |
setSkipFailedInvocations(boolean s) |
void |
setTestClass(ITestClass tc)
Sets the test class having this method.
|
void |
setThreadPoolSize(int threadPoolSize)
No-op.
|
void |
setTimeOut(long timeOut) |
void |
setXmlTest(XmlTest xmlTest) |
boolean |
skipFailedInvocations() |
String |
toString() |
protected ITestClass m_testClass
protected final Class<?> m_methodClass
protected final ConstructorOrMethod m_method
protected String m_id
protected long m_date
protected final IAnnotationFinder m_annotationFinder
protected String[] m_groups
protected String[] m_groupsDependedUpon
protected String[] m_methodsDependedUpon
protected String[] m_beforeGroups
protected String[] m_afterGroups
protected AtomicInteger m_currentInvocationCount
public static final Comparator<?> DATE_COMPARATOR
public BaseTestMethod(String methodName, Method method, IAnnotationFinder annotationFinder, Object instance)
BaseTestMethod
TODO cquezel JavaDoc.method
- annotationFinder
- instance
- public BaseTestMethod(String methodName, ConstructorOrMethod com, IAnnotationFinder annotationFinder, Object instance)
public boolean isAlwaysRun()
isAlwaysRun
in interface ITestNGMethod
protected void setAlwaysRun(boolean alwaysRun)
alwaysRun
- public Class<?> getRealClass()
getRealClass
in interface ITestNGMethod
public ITestClass getTestClass()
getTestClass
in interface ITestNGMethod
public void setTestClass(ITestClass tc)
setTestClass
in interface ITestNGMethod
tc
- The test class having this method.public Method getMethod()
getMethod
in interface ITestNGMethod
public String getMethodName()
getMethodName
in interface ITestNGMethod
public Object[] getInstances()
getInstances
in interface ITestNGMethod
public Object getInstance()
getInstance
in interface ITestNGMethod
public long[] getInstanceHashCodes()
getInstanceHashCodes
in interface ITestNGMethod
public String[] getGroups()
getGroups
in interface ITestNGMethod
public String[] getGroupsDependedUpon()
getGroupsDependedUpon
in interface ITestNGMethod
public String[] getMethodsDependedUpon()
getMethodsDependedUpon
in interface ITestNGMethod
public boolean isTest()
isTest
in interface ITestNGMethod
public boolean isBeforeSuiteConfiguration()
isBeforeSuiteConfiguration
in interface ITestNGMethod
public boolean isAfterSuiteConfiguration()
isAfterSuiteConfiguration
in interface ITestNGMethod
public boolean isBeforeTestConfiguration()
isBeforeTestConfiguration
in interface ITestNGMethod
public boolean isAfterTestConfiguration()
isAfterTestConfiguration
in interface ITestNGMethod
public boolean isBeforeGroupsConfiguration()
isBeforeGroupsConfiguration
in interface ITestNGMethod
public boolean isAfterGroupsConfiguration()
isAfterGroupsConfiguration
in interface ITestNGMethod
public boolean isBeforeClassConfiguration()
isBeforeClassConfiguration
in interface ITestNGMethod
public boolean isAfterClassConfiguration()
isAfterClassConfiguration
in interface ITestNGMethod
public boolean isBeforeMethodConfiguration()
isBeforeMethodConfiguration
in interface ITestNGMethod
public boolean isAfterMethodConfiguration()
isAfterMethodConfiguration
in interface ITestNGMethod
public long getTimeOut()
getTimeOut
in interface ITestNGMethod
public void setTimeOut(long timeOut)
setTimeOut
in interface ITestNGMethod
public int getInvocationCount()
getInvocationCount
in interface ITestNGMethod
public void setInvocationCount(int counter)
setInvocationCount
in interface ITestNGMethod
public int getTotalInvocationCount()
getTotalInvocationCount
in interface ITestNGMethod
public int getSuccessPercentage()
getSuccessPercentage
in interface ITestNGMethod
public String getId()
getId
in interface ITestNGMethod
public void setId(String id)
setId
in interface ITestNGMethod
public long getDate()
getDate
in interface ITestNGMethod
public void setDate(long date)
setDate
in interface ITestNGMethod
date
- The date to set.public boolean canRunFromClass(IClass testClass)
canRunFromClass
in interface ITestNGMethod
public boolean equals(Object obj)
public int hashCode()
protected void initGroups(Class<? extends ITestOrConfiguration> annotationClass)
protected void initBeforeAfterGroups(Class<? extends ITestOrConfiguration> annotationClass, String[] groups)
protected IAnnotationFinder getAnnotationFinder()
protected IClass getIClass()
public String getSimpleName()
protected String getSignature()
protected void setGroups(String[] groups)
protected void setGroupsDependedUpon(String[] groups, Collection<String> xmlGroupDependencies)
protected void setMethodsDependedUpon(String[] methods)
public void addMethodDependedUpon(String method)
addMethodDependedUpon
in interface ITestNGMethod
public String getMissingGroup()
getMissingGroup
in interface ITestNGMethod
public void setMissingGroup(String group)
setMissingGroup
in interface ITestNGMethod
public int getThreadPoolSize()
getThreadPoolSize
in interface ITestNGMethod
public void setThreadPoolSize(int threadPoolSize)
setThreadPoolSize
in interface ITestNGMethod
public void setDescription(String description)
setDescription
in interface ITestNGMethod
public String getDescription()
getDescription
in interface ITestNGMethod
public void setEnabled(boolean enabled)
public boolean getEnabled()
getEnabled
in interface ITestNGMethod
public String[] getBeforeGroups()
getBeforeGroups
in interface ITestNGMethod
public String[] getAfterGroups()
getAfterGroups
in interface ITestNGMethod
public void incrementCurrentInvocationCount()
incrementCurrentInvocationCount
in interface ITestNGMethod
public int getCurrentInvocationCount()
getCurrentInvocationCount
in interface ITestNGMethod
public void setParameterInvocationCount(int n)
setParameterInvocationCount
in interface ITestNGMethod
public int getParameterInvocationCount()
getParameterInvocationCount
in interface ITestNGMethod
public void setMoreInvocationChecker(Callable<Boolean> moreInvocationChecker)
setMoreInvocationChecker
in interface ITestNGMethod
public boolean hasMoreInvocation()
hasMoreInvocation
in interface ITestNGMethod
public abstract ITestNGMethod clone()
clone
in interface ITestNGMethod
clone
in class Object
public IRetryAnalyzer getRetryAnalyzer()
getRetryAnalyzer
in interface ITestNGMethod
public void setRetryAnalyzer(IRetryAnalyzer retryAnalyzer)
setRetryAnalyzer
in interface ITestNGMethod
public boolean skipFailedInvocations()
skipFailedInvocations
in interface ITestNGMethod
public void setSkipFailedInvocations(boolean s)
setSkipFailedInvocations
in interface ITestNGMethod
public void setInvocationTimeOut(long timeOut)
public long getInvocationTimeOut()
ITestNGMethod
getInvocationTimeOut
in interface ITestNGMethod
public boolean ignoreMissingDependencies()
ignoreMissingDependencies
in interface ITestNGMethod
public void setIgnoreMissingDependencies(boolean i)
setIgnoreMissingDependencies
in interface ITestNGMethod
public List<Integer> getInvocationNumbers()
ITestNGMethod
getInvocationNumbers
in interface ITestNGMethod
public void setInvocationNumbers(List<Integer> numbers)
setInvocationNumbers
in interface ITestNGMethod
public List<Integer> getFailedInvocationNumbers()
getFailedInvocationNumbers
in interface ITestNGMethod
public void addFailedInvocationNumber(int number)
ITestNGMethod
addFailedInvocationNumber
in interface ITestNGMethod
public int getPriority()
ITestNGMethod
getPriority
in interface ITestNGMethod
public void setPriority(int priority)
setPriority
in interface ITestNGMethod
public XmlTest getXmlTest()
getXmlTest
in interface ITestNGMethod
public void setXmlTest(XmlTest xmlTest)
public ConstructorOrMethod getConstructorOrMethod()
getConstructorOrMethod
in interface ITestNGMethod
public Map<String,String> findMethodParameters(XmlTest test)
findMethodParameters
in interface ITestNGMethod
public String getQualifiedName()
ITestNGMethod
getQualifiedName
in interface ITestNGMethod
Copyright © 2024. All rights reserved.