public abstract class BaseTestMethod extends java.lang.Object implements ITestNGMethod
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<?> |
DATE_COMPARATOR
Compares two ITestNGMethod by date.
|
protected java.lang.String[] |
m_afterGroups |
protected IAnnotationFinder |
m_annotationFinder |
protected java.lang.String[] |
m_beforeGroups |
protected java.util.concurrent.atomic.AtomicInteger |
m_currentInvocationCount |
protected long |
m_date |
private java.lang.String |
m_description |
private boolean |
m_enabled |
private java.util.List<java.lang.Integer> |
m_failedInvocationNumbers |
protected java.lang.String[] |
m_groups |
protected java.lang.String[] |
m_groupsDependedUpon |
protected java.lang.String |
m_id |
private boolean |
m_ignoreMissingDependencies |
private java.lang.Object |
m_instance |
private java.util.List<java.lang.Integer> |
m_invocationNumbers |
private long |
m_invocationTimeOut |
private boolean |
m_isAlwaysRun |
protected ConstructorOrMethod |
m_method |
protected java.lang.Class<?> |
m_methodClass |
private java.lang.String |
m_methodName |
protected java.lang.String[] |
m_methodsDependedUpon |
private java.lang.String |
m_missingGroup |
private java.util.concurrent.Callable<java.lang.Boolean> |
m_moreInvocationChecker |
private int |
m_parameterInvocationCount |
private int |
m_priority |
private IRetryAnalyzer |
m_retryAnalyzer |
private java.lang.String |
m_signature |
private boolean |
m_skipFailedInvocations |
protected ITestClass |
m_testClass
The test class on which the test method was found.
|
private long |
m_timeOut |
private XmlTest |
m_xmlTest |
private static long |
serialVersionUID |
private static java.util.regex.Pattern |
SPACE_SEPARATOR_PATTERN |
Constructor and Description |
---|
BaseTestMethod(java.lang.String methodName,
ConstructorOrMethod com,
IAnnotationFinder annotationFinder,
java.lang.Object instance) |
BaseTestMethod(java.lang.String methodName,
java.lang.reflect.Method method,
IAnnotationFinder annotationFinder,
java.lang.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(java.lang.String method) |
private static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
calculateXmlGroupDependencies(XmlTest xmlTest) |
boolean |
canRunFromClass(IClass testClass)
Returns if this ITestNGMethod can be invoked from within IClass.
|
abstract ITestNGMethod |
clone() |
int |
compareTo(java.lang.Object o) |
private java.lang.String |
computeSignature() |
boolean |
equals(java.lang.Object obj)
Compares two BaseTestMethod using the test class then the associated
Java Method.
|
java.util.Map<java.lang.String,java.lang.String> |
findMethodParameters(XmlTest test) |
java.lang.String[] |
getAfterGroups() |
protected IAnnotationFinder |
getAnnotationFinder() |
java.lang.String[] |
getBeforeGroups()
Before and After groups
|
ConstructorOrMethod |
getConstructorOrMethod() |
int |
getCurrentInvocationCount() |
long |
getDate() |
java.lang.String |
getDescription() |
boolean |
getEnabled() |
java.util.List<java.lang.Integer> |
getFailedInvocationNumbers() |
java.lang.String[] |
getGroups() |
java.lang.String[] |
getGroupsDependedUpon() |
protected IClass |
getIClass() |
java.lang.String |
getId() |
java.lang.Object |
getInstance() |
long[] |
getInstanceHashCodes()
Needed for serialization.
|
java.lang.Object[] |
getInstances() |
int |
getInvocationCount() |
java.util.List<java.lang.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.
|
java.lang.reflect.Method |
getMethod() |
java.lang.String |
getMethodName()
Returns the method name.
|
java.lang.String[] |
getMethodsDependedUpon() |
java.lang.String |
getMissingGroup()
If a group was not found.
|
int |
getParameterInvocationCount() |
int |
getPriority()
The scheduling priority.
|
java.lang.Class<?> |
getRealClass() |
IRetryAnalyzer |
getRetryAnalyzer() |
protected java.lang.String |
getSignature() |
java.lang.String |
getSimpleName() |
protected java.lang.String[] |
getStringArray(java.lang.String[] methodArray,
java.lang.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 |
initGroups(java.lang.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() |
private static void |
ppp(java.lang.String s) |
protected void |
setAlwaysRun(boolean alwaysRun)
TODO cquezel JavaDoc.
|
void |
setDate(long date) |
void |
setDescription(java.lang.String description) |
void |
setEnabled(boolean enabled) |
protected void |
setGroups(java.lang.String[] groups) |
protected void |
setGroupsDependedUpon(java.lang.String[] groups,
java.util.Collection<java.lang.String> xmlGroupDependencies) |
void |
setId(java.lang.String id) |
void |
setIgnoreMissingDependencies(boolean i) |
void |
setInvocationCount(int counter)
No-op.
|
void |
setInvocationNumbers(java.util.List<java.lang.Integer> numbers) |
void |
setInvocationTimeOut(long timeOut) |
protected void |
setMethodsDependedUpon(java.lang.String[] methods) |
void |
setMissingGroup(java.lang.String group) |
void |
setMoreInvocationChecker(java.util.concurrent.Callable<java.lang.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() |
java.lang.String |
toString() |
private static final long serialVersionUID
private static final java.util.regex.Pattern SPACE_SEPARATOR_PATTERN
protected ITestClass m_testClass
protected final transient java.lang.Class<?> m_methodClass
protected final transient ConstructorOrMethod m_method
private transient java.lang.String m_signature
protected java.lang.String m_id
protected long m_date
protected final transient IAnnotationFinder m_annotationFinder
protected java.lang.String[] m_groups
protected java.lang.String[] m_groupsDependedUpon
protected java.lang.String[] m_methodsDependedUpon
protected java.lang.String[] m_beforeGroups
protected java.lang.String[] m_afterGroups
private boolean m_isAlwaysRun
private boolean m_enabled
private final java.lang.String m_methodName
private java.lang.String m_missingGroup
private java.lang.String m_description
protected java.util.concurrent.atomic.AtomicInteger m_currentInvocationCount
private int m_parameterInvocationCount
private java.util.concurrent.Callable<java.lang.Boolean> m_moreInvocationChecker
private IRetryAnalyzer m_retryAnalyzer
private boolean m_skipFailedInvocations
private long m_invocationTimeOut
private java.util.List<java.lang.Integer> m_invocationNumbers
private final java.util.List<java.lang.Integer> m_failedInvocationNumbers
private long m_timeOut
private boolean m_ignoreMissingDependencies
private int m_priority
private XmlTest m_xmlTest
private java.lang.Object m_instance
public static final java.util.Comparator<?> DATE_COMPARATOR
public BaseTestMethod(java.lang.String methodName, java.lang.reflect.Method method, IAnnotationFinder annotationFinder, java.lang.Object instance)
BaseTestMethod
TODO cquezel JavaDoc.method
- annotationFinder
- instance
- public BaseTestMethod(java.lang.String methodName, ConstructorOrMethod com, IAnnotationFinder annotationFinder, java.lang.Object instance)
public boolean isAlwaysRun()
isAlwaysRun
in interface ITestNGMethod
protected void setAlwaysRun(boolean alwaysRun)
alwaysRun
- public java.lang.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 int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.reflect.Method getMethod()
getMethod
in interface ITestNGMethod
public java.lang.String getMethodName()
getMethodName
in interface ITestNGMethod
public java.lang.Object[] getInstances()
getInstances
in interface ITestNGMethod
public java.lang.Object getInstance()
getInstance
in interface ITestNGMethod
public long[] getInstanceHashCodes()
getInstanceHashCodes
in interface ITestNGMethod
public java.lang.String[] getGroups()
getGroups
in interface ITestNGMethod
public java.lang.String[] getGroupsDependedUpon()
getGroupsDependedUpon
in interface ITestNGMethod
public java.lang.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 java.lang.String getId()
getId
in interface ITestNGMethod
public void setId(java.lang.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(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void initGroups(java.lang.Class<? extends ITestOrConfiguration> annotationClass)
private static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> calculateXmlGroupDependencies(XmlTest xmlTest)
protected IAnnotationFinder getAnnotationFinder()
protected IClass getIClass()
private java.lang.String computeSignature()
public java.lang.String getSimpleName()
protected java.lang.String getSignature()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String[] getStringArray(java.lang.String[] methodArray, java.lang.String[] classArray)
protected void setGroups(java.lang.String[] groups)
protected void setGroupsDependedUpon(java.lang.String[] groups, java.util.Collection<java.lang.String> xmlGroupDependencies)
protected void setMethodsDependedUpon(java.lang.String[] methods)
public void addMethodDependedUpon(java.lang.String method)
addMethodDependedUpon
in interface ITestNGMethod
private static void ppp(java.lang.String s)
public java.lang.String getMissingGroup()
getMissingGroup
in interface ITestNGMethod
public void setMissingGroup(java.lang.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(java.lang.String description)
setDescription
in interface ITestNGMethod
public java.lang.String getDescription()
getDescription
in interface ITestNGMethod
public void setEnabled(boolean enabled)
public boolean getEnabled()
getEnabled
in interface ITestNGMethod
public java.lang.String[] getBeforeGroups()
getBeforeGroups
in interface ITestNGMethod
public java.lang.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(java.util.concurrent.Callable<java.lang.Boolean> moreInvocationChecker)
setMoreInvocationChecker
in interface ITestNGMethod
public boolean hasMoreInvocation()
hasMoreInvocation
in interface ITestNGMethod
public abstract ITestNGMethod clone()
clone
in interface ITestNGMethod
clone
in class java.lang.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 java.util.List<java.lang.Integer> getInvocationNumbers()
ITestNGMethod
getInvocationNumbers
in interface ITestNGMethod
public void setInvocationNumbers(java.util.List<java.lang.Integer> numbers)
setInvocationNumbers
in interface ITestNGMethod
public java.util.List<java.lang.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 java.util.Map<java.lang.String,java.lang.String> findMethodParameters(XmlTest test)
findMethodParameters
in interface ITestNGMethod