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 enumConfiguration failure policy options.static enumParallel modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Booleanstatic final XmlSuite.FailurePolicyWhether to SKIP or CONTINUE to re-attempt failed configuration methods.static final IntegerThread count for the data provider pool.static final BooleanBy default, a method failing will cause all instances of that class to skip.static final BooleanMixed mode flag.static final XmlSuite.ParallelModestatic final Booleanstatic final Booleanstatic final IntegerThe thread count.static final IntegerThe suite verbose flag (0 to 10).final UUIDRepresents a unique id for this suite. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddListener(String listener) voidclone()Note that this is not a full clone: XmlTest children are not cloned by this method.booleanReturns the configuration failure policy.intReturns the method selectors.getName()Returns the name.Class<? extends ITestObjectFactory> 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.intReturns the timeout.longgetTimeOut(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.inthashCode()booleanisParsed()booleanvoidonListenerElement(String className) voidonMethodSelectorElement(String language, String name, String priority) voidonPackagesElement(String name) voidonParameterElement(String name, String value) voidonSuiteFilesElement(String path) voidsetAllowReturnValues(Boolean allowReturnValues) voidsetConfigFailurePolicy(XmlSuite.FailurePolicy configFailurePolicy) Sets the configuration failure policy.voidsetDataProviderThreadCount(int count) voidvoidsetFileName(String fileName) voidsetGroupByInstances(boolean f) voidvoidsetGuiceStage(String guiceStage) voidvoidsetListeners(List<String> listeners) voidsetMethodSelectors(List<XmlMethodSelector> methodSelectors) Sets the method selectors.voidvoidSets the name.voidsetObjectFactoryClass(Class<? extends ITestObjectFactory> objectFactoryClass) voidsetPackages(List<XmlPackage> packages) voidsetParallel(XmlSuite.ParallelMode parallel) Sets the parallel mode.voidsetParameters(Map<String, String> parameters) Sets parameters.voidsetParentModule(String parentModule) voidsetParentSuite(XmlSuite parentSuite) voidsetParsed(boolean parsed) voidvoidsetShareThreadPoolForDataProviders(boolean shareThreadPoolForDataProviders) voidsetSkipFailedInvocationCounts(boolean skip) voidsetSuiteFiles(List<String> files) Sets the suite files.voidvoidsetThreadCount(int threadCount) Set the thread count.voidsetTimeOut(String timeOut) Sets the timeout.voidsetVerbose(Integer verbose) Set the verbose.voidvoidsetXmlPackages(List<XmlPackage> packages) Sets the XML packages.This method returns a shallow cloned version.voidshouldUseGlobalThreadPool(boolean flag) toString()toXml()boolean
-
Field Details
-
DEFAULT_VERBOSE
The suite verbose flag (0 to 10). -
DEFAULT_PARALLEL
-
SUITE_ID
Represents a unique id for this suite. Can be used for uniquely identifying the xml suite. -
DEFAULT_CONFIG_FAILURE_POLICY
Whether to SKIP or CONTINUE to re-attempt failed configuration methods. -
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:
- -
trueif the currentXmlSuitehas 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
-
getObjectFactoryClass
-
useGlobalThreadPool
public boolean useGlobalThreadPool() -
shouldUseGlobalThreadPool
public void shouldUseGlobalThreadPool(boolean flag) -
setObjectFactoryClass
-
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.
-
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.XmlTests 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
-