Package org.testng.xml
Class XmlSuite
java.lang.Object
org.testng.xml.XmlSuite
- All Implemented Interfaces:
Cloneable
This class describes the tag <suite> in testng.xml.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Configuration failure policy options.static enum
Parallel modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Boolean
static final XmlSuite.FailurePolicy
Whether to SKIP or CONTINUE to re-attempt failed configuration methods.static final Integer
Thread count for the data provider pool.static final Boolean
By default, a method failing will cause all instances of that class to skip.static final Boolean
JUnit compatibility flag.static final Boolean
Mixed mode flag.static final XmlSuite.ParallelMode
static final Boolean
static final Boolean
static final Integer
The thread count.static final Integer
The suite verbose flag (0 to 10). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addListener
(String listener) void
clone()
Note that this is not a full clone: XmlTest children are not cloned by this method.boolean
Returns the configuration failure policy.int
Returns the method selectors.getName()
Returns the name.Returns the parallel mode.getParameter
(String name) Returns the parameter defined in this suite only.Returns the suite files.getTest()
Returns the test.getTests()
Returns the tests.int
Returns the timeout.long
getTimeOut
(long def) Returns the timeout as a long value specifying the default value to be used if no timeout was specified.Returns the verbose.Returns the XML packages.int
hashCode()
isJUnit()
boolean
isParsed()
void
onListenerElement
(String className) void
onMethodSelectorElement
(String language, String name, String priority) void
onPackagesElement
(String name) void
onParameterElement
(String name, String value) void
onSuiteFilesElement
(String path) void
setAllowReturnValues
(Boolean allowReturnValues) void
setConfigFailurePolicy
(XmlSuite.FailurePolicy configFailurePolicy) Sets the configuration failure policy.void
setDataProviderThreadCount
(int count) void
void
setFileName
(String fileName) void
setGroupByInstances
(boolean f) void
void
setGuiceStage
(String guiceStage) void
void
void
Sets the JUnit compatibility flag.void
setListeners
(List<String> listeners) void
setMethodSelectors
(List<XmlMethodSelector> methodSelectors) Sets the method selectors.void
void
Sets the name.void
setObjectFactory
(ITestObjectFactory objectFactory) void
setPackages
(List<XmlPackage> packages) void
setParallel
(XmlSuite.ParallelMode parallel) Sets the parallel mode.void
setParameters
(Map<String, String> parameters) Sets parameters.void
setParentModule
(String parentModule) void
setParentSuite
(XmlSuite parentSuite) void
setParsed
(boolean parsed) void
void
setSkipFailedInvocationCounts
(boolean skip) void
setSuiteFiles
(List<String> files) Sets the suite files.void
void
setThreadCount
(int threadCount) Set the thread count.void
setTimeOut
(String timeOut) Sets the timeout.void
setVerbose
(Integer verbose) Set the verbose.void
void
setXmlPackages
(List<XmlPackage> packages) Sets the XML packages.This method returns a shallow cloned version.toString()
toXml()
-
Field Details
-
DEFAULT_VERBOSE
The suite verbose flag (0 to 10). -
DEFAULT_PARALLEL
-
DEFAULT_CONFIG_FAILURE_POLICY
Whether to SKIP or CONTINUE to re-attempt failed configuration methods. -
DEFAULT_JUNIT
JUnit compatibility flag. -
DEFAULT_MIXED
Mixed mode flag. -
DEFAULT_SKIP_FAILED_INVOCATION_COUNTS
-
DEFAULT_THREAD_COUNT
The thread count. -
DEFAULT_DATA_PROVIDER_THREAD_COUNT
Thread count for the data provider pool. -
DEFAULT_GROUP_BY_INSTANCES
By default, a method failing will cause all instances of that class to skip. -
DEFAULT_ALLOW_RETURN_VALUES
-
DEFAULT_PRESERVE_ORDER
-
-
Constructor Details
-
XmlSuite
public XmlSuite()
-
-
Method Details
-
setParsed
public void setParsed(boolean parsed) -
isParsed
public boolean isParsed()- Returns:
- -
true
if the currentXmlSuite
has already been parsed.
-
getFileName
- Returns:
- The fileName.
-
setFileName
- Parameters:
fileName
- The fileName to set.
-
getParallel
Returns the parallel mode.- Returns:
- The parallel mode.
-
getParentModule
-
getGuiceStage
-
getObjectFactory
-
setObjectFactory
-
setParallel
Sets the parallel mode.- Parameters:
parallel
- The parallel mode.
-
setParentModule
-
setGuiceStage
-
setConfigFailurePolicy
Sets the configuration failure policy.- Parameters:
configFailurePolicy
- The config failure policy.
-
getConfigFailurePolicy
Returns the configuration failure policy.- Returns:
- The configuration failure policy.
-
getVerbose
Returns the verbose.- Returns:
- The verbose.
-
setVerbose
Set the verbose.- Parameters:
verbose
- The verbose to set.
-
getName
Returns the name.- Returns:
- The name.
-
setName
Sets the name.- Parameters:
name
- The name to set.
-
getTest
Returns the test.- Returns:
- The test.
-
getTests
Returns the tests.- Returns:
- The tests.
-
setTests
-
getMethodSelectors
Returns the method selectors.- Returns:
- The method selectors.
-
setMethodSelectors
Sets the method selectors.- Parameters:
methodSelectors
- The method selectors.
-
setParameters
Sets parameters.- Parameters:
parameters
- The parameters.
-
getParameters
- Returns:
- the parameters that apply to tests in this suite.
The set of parameters for a suite is appended with parameters from the parent suite. Also, parameters from this suite override the same named parameters from the parent suite.
-
getAllParameters
- Returns:
- The parameters defined in this suite and all its XmlTests.
-
getParameter
Returns the parameter defined in this suite only.- Parameters:
name
- The parameter name.- Returns:
- The parameter defined in this suite only.
-
getThreadCount
public int getThreadCount()- Returns:
- The threadCount.
-
setThreadCount
public void setThreadCount(int threadCount) Set the thread count.- Parameters:
threadCount
- The thread count to set.
-
isJUnit
- Returns:
- The JUnit compatibility flag.
-
setJUnit
Sets the JUnit compatibility flag.- Parameters:
isJUnit
- The JUnit compatibility flag.
-
setJunit
-
skipFailedInvocationCounts
-
setSkipFailedInvocationCounts
public void setSkipFailedInvocationCounts(boolean skip) -
setXmlPackages
Sets the XML packages.- Parameters:
packages
- The XML packages.
-
getXmlPackages
Returns the XML packages.- Returns:
- The XML packages.
-
getPackages
-
setMethodSelectors
-
setPackages
-
toXml
- Returns:
- A String representation of this XML suite.
-
getLocalListeners
- Returns:
- - The list of listener names that are local to the current <suite>.
-
setXmlMethodSelectors
-
getXmlMethodSelectors
-
toString
-
clone
Note that this is not a full clone: XmlTest children are not cloned by this method. -
shallowCopy
This method returns a shallow cloned version.XmlTest
s are not copied by this method.- Returns:
- - A shallow copied version of
XmlSuite
.
-
setTimeOut
Sets the timeout.- Parameters:
timeOut
- The timeout.
-
getTimeOut
Returns the timeout.- Returns:
- The timeout.
-
getTimeOut
public long getTimeOut(long def) Returns the timeout as a long value specifying the default value to be used if no timeout was specified.- Parameters:
def
- The default value to be used if no timeout was specified.- Returns:
- The timeout as a long value specifying the default value to be used if no timeout was specified.
-
setSuiteFiles
Sets the suite files.- Parameters:
files
- The suite files.
-
getSuiteFiles
Returns the suite files.- Returns:
- The suite files.
-
setListeners
-
getListeners
-
setDataProviderThreadCount
public void setDataProviderThreadCount(int count) -
getDataProviderThreadCount
public int getDataProviderThreadCount() -
setParentSuite
-
getParentSuite
-
getChildSuites
-
hashCode
public int hashCode() -
equals
-
setPreserveOrder
-
getPreserveOrder
-
getIncludedGroups
- Returns:
- Returns the includedGroups. Note: do not modify the returned value, use
addIncludedGroup(String)
.
-
addIncludedGroup
-
setIncludedGroups
- Parameters:
g
- - The list of groups to include.
-
setExcludedGroups
- Parameters:
g
- The excludedGrousps to set.
-
getExcludedGroups
- Returns:
- Returns the excludedGroups. Note: do not modify the returned value, use
addExcludedGroup(String)
.
-
addExcludedGroup
-
getGroupByInstances
-
setGroupByInstances
public void setGroupByInstances(boolean f) -
addListener
-
getAllowReturnValues
-
setAllowReturnValues
-
setGroups
-
onParameterElement
-
onListenerElement
-
onSuiteFilesElement
-
onPackagesElement
-
onMethodSelectorElement
-
getGroups
-
addTest
-
getPackageNames
-