Package org.testng.xml
Class XmlTest
java.lang.Object
org.testng.xml.XmlTest
- All Implemented Interfaces:
Cloneable
This class describes the tag <test> in testng.xml.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addMetaGroup
(String name, String... metaGroup) void
addMetaGroup
(String name, List<String> metaGroup) void
addParameter
(String key, String value) void
addXmlDependencyGroup
(String group, String dependsOn) clone()
Clone thesource
XmlTest
by including: - test attributes - groups definitions - parametersboolean
boolean
int
getIndex()
Note that this attribute does not come from the XML file, it's calculated internally and represents the order in which this test tag was found in its <suite> tag.getInvocationNumbers
(String method) Convenience method to cache the ordering numbers for methods.getName()
getParameter
(String name) final XmlSuite
getSuite()
Returns the suite this test is part of.int
long
getTimeOut
(long def) int
int
hashCode()
boolean
boolean
nameMatchesAny
(List<String> names) void
setAllowReturnValues
(Boolean allowReturnValues) void
setClasses
(List<XmlClass> c) void
void
setGroupByInstances
(boolean f) void
void
void
setIndex
(int index) void
setMetaGroups
(Map<String, List<String>> metaGroups) void
setMethodSelectors
(List<XmlMethodSelector> methodSelectors) void
void
void
setParallel
(XmlSuite.ParallelMode parallel) void
setParameters
(Map<String, String> parameters) void
setPreserveOrder
(Boolean preserveOrder) void
void
setSkipFailedInvocationCounts
(boolean skip) void
void
setThreadCount
(int threadCount) void
setTimeOut
(long timeOut) void
setVerbose
(int v) void
setXmlClasses
(List<XmlClass> classes) Sets the XML Classes.void
setXmlDependencyGroups
(Map<String, String> xmlDependencyGroups) void
setXmlPackages
(List<XmlPackage> packages) void
setXmlSuite
(XmlSuite suite) boolean
-
Field Details
-
DEFAULT_TIMEOUT_MS
public static final int DEFAULT_TIMEOUT_MS- See Also:
-
-
Constructor Details
-
XmlTest
Constructs aXmlTest
and adds it to suite's list of tests.- Parameters:
suite
- the parent suite.index
- the index of this test tag in testng.xml
-
XmlTest
-
XmlTest
public XmlTest()
-
-
Method Details
-
setXmlPackages
-
getXmlPackages
-
getPackages
-
setPackages
-
getMethodSelectors
-
setMethodSelectors
-
getSuite
Returns the suite this test is part of.- Returns:
- the suite this test is part of.
-
getIncludedGroups
- Returns:
- the includedGroups.
-
isGroupFilteringDisabled
public boolean isGroupFilteringDisabled() -
getXmlClasses
- Returns:
- Returns the classes.
-
getClasses
-
setClasses
-
setXmlClasses
Sets the XML Classes.- Parameters:
classes
- The classes to set.
-
getName
- Returns:
- Returns the name.
-
setName
- Parameters:
name
- The name to set.
-
setVerbose
public void setVerbose(int v) - Parameters:
v
- - Verbosity level.
-
getThreadCount
public int getThreadCount() -
setThreadCount
public void setThreadCount(int threadCount) -
setIncludedGroups
-
setExcludedGroups
-
getExcludedGroups
-
addIncludedGroup
-
addExcludedGroup
-
getVerbose
public int getVerbose()- Returns:
- Returns the verbose.
-
getGroupByInstances
public boolean getGroupByInstances() -
setGroupByInstances
public void setGroupByInstances(boolean f) -
setSkipFailedInvocationCounts
public void setSkipFailedInvocationCounts(boolean skip) -
skipFailedInvocationCounts
public boolean skipFailedInvocationCounts()- Returns:
- Returns the isJUnit.
-
addMetaGroup
-
addMetaGroup
-
setMetaGroups
-
getMetaGroups
- Returns:
- Returns the metaGroups.
-
setParameters
- Parameters:
parameters
- - AMap
of parameters.
-
addParameter
-
getParameter
-
getAllParameters
- Returns:
- the parameters defined in this test tag and the tags above it.
-
getLocalParameters
- Returns:
- the parameters defined in this tag, and only this test tag. To retrieve the inherited
parameters as well, call
getAllParameters()
.
-
setParallel
-
getParallel
-
getTimeOut
-
getTimeOut
public long getTimeOut(long def) -
setTimeOut
public void setTimeOut(long timeOut) -
setScript
-
getScript
-
toXml
-
clone
Clone thesource
XmlTest
by including: - test attributes - groups definitions - parametersThe <classes> sub element is ignored for the moment.
-
getInvocationNumbers
Convenience method to cache the ordering numbers for methods.- Parameters:
method
- The method name- Returns:
- The invocation numbers of the method
-
setPreserveOrder
-
getPreserveOrder
-
setSuite
-
getAllowReturnValues
-
setAllowReturnValues
-
getIndex
public int getIndex()Note that this attribute does not come from the XML file, it's calculated internally and represents the order in which this test tag was found in its <suite> tag. It's used to calculate the ordering of the tests when preserve-test-order is true.- Returns:
- The value
-
setIndex
public void setIndex(int index) -
hashCode
public int hashCode() -
equals
-
addXmlDependencyGroup
-
getXmlDependencyGroups
-
setXmlDependencyGroups
-
setXmlSuite
-
setGroups
-
getXmlGroups
-
nameMatchesAny
- Parameters:
names
- The list of names to check.- Returns:
true
if the current test's name matches with any of the given names.
-