org.testng.xml
Class XmlSuite

java.lang.Object  extended by org.testng.xml.XmlSuite
All Implemented Interfaces:
Serializable, Cloneable

public class XmlSuite
extends Object
implements Serializable, Cloneable

This class describes the tag <suite> in testng.xml.

Author:
Cedric Beust, Alexandru Popescu
See Also:
Serialized Form


Field Summary
static StringCONTINUE
           
static BooleanDEFAULT_ALLOW_RETURN_VALUES
           
static StringDEFAULT_CONFIG_FAILURE_POLICY
          Whether to SKIP or CONTINUE to re-attempt failed configuration methods.
static IntegerDEFAULT_DATA_PROVIDER_THREAD_COUNT
          Thread count for the data provider pool
static BooleanDEFAULT_GROUP_BY_INSTANCES
          By default, a method failing will cause all instances of that class to skip
static BooleanDEFAULT_JUNIT
          JUnit compatibility flag.
static BooleanDEFAULT_MIXED
          mixed mode flag.
static StringDEFAULT_PARALLEL
           
static StringDEFAULT_PRESERVE_ORDER
           
static BooleanDEFAULT_SKIP_FAILED_INVOCATION_COUNTS
           
static IntegerDEFAULT_THREAD_COUNT
          The thread count.
static IntegerDEFAULT_VERBOSE
          The suite verbose flag.
static StringPARALLEL_CLASSES
           
static StringPARALLEL_INSTANCES
           
static StringPARALLEL_METHODS
           
static Set<String>PARALLEL_MODES
           
static StringPARALLEL_NONE
           
static StringPARALLEL_TESTS
          Parallel modes
static StringSKIP
          Configuration failure policy options
 
Constructor Summary
XmlSuite()
           
 
Method Summary
 voidaddExcludedGroup(String g)
           
 voidaddIncludedGroup(String g)
           
 voidaddListener(String listener)
           
 voidaddTest(XmlTest test)
           
 Objectclone()
           Note that this is not a full clone: XmlTest children are not cloned by this method.
 booleanequals(Object obj)
           
 BooleangetAllowReturnValues()
           
 Map<String,String>getAllParameters()
           
 List<XmlSuite>getChildSuites()
           
 StringgetConfigFailurePolicy()
          Returns the configuration failure policy.
 intgetDataProviderThreadCount()
           
 List<String>getExcludedGroups()
           
 StringgetFileName()
           
 BooleangetGroupByInstances()
           
 XmlGroupsgetGroups()
           
 List<String>getIncludedGroups()
           
 List<String>getListeners()
           
 List<XmlMethodSelector>getMethodSelectors()
          Returns the method selectors.
 StringgetName()
          Returns the name.
 ITestObjectFactorygetObjectFactory()
           
 Collection<String>getPackageNames()
           
 List<XmlPackage>getPackages()
           
 StringgetParallel()
          Returns the parallel mode.
 StringgetParameter(String name)
          Returns the parameter defined in this suite only.
 Map<String,String>getParameters()
          Gets the parameters that apply to tests in this suite.
Set of parameters for a suite is appended with parameters from parent suite.
 XmlSuitegetParentSuite()
           
 StringgetPreserveOrder()
           
 List<String>getSuiteFiles()
          Returns the suite files.
 StringgetTest()
          Returns the test.
 List<XmlTest>getTests()
          Returns the tests.
 intgetThreadCount()
           
 StringgetTimeOut()
          Returns the timeout.
 longgetTimeOut(long def)
          Returns the timeout as a long value specifying the default value to be used if no timeout was specified.
 IntegergetVerbose()
          Returns the verbose.
 List<XmlPackage>getXmlPackages()
          Returns the XML packages.
 inthashCode()
           
 BooleanisJUnit()
           
static booleanisParallel(String parallel)
           
 voidonListenerElement(String className)
           
 voidonMethodSelectorElement(String language, String name, String priority)
           
 voidonPackagesElement(String name)
           
 voidonParameterElement(String name, String value)
           
 voidonSuiteFilesElement(String path)
           
 voidsetAllowReturnValues(Boolean allowReturnValues)
           
 voidsetConfigFailurePolicy(String configFailurePolicy)
          Sets the configuration failure policy.
 voidsetDataProviderThreadCount(int count)
           
 voidsetExcludedGroups(List<String> g)
           
 voidsetFileName(String fileName)
           
 voidsetGroupByInstances(boolean f)
           
 voidsetGroups(XmlGroups xmlGroups)
           
 voidsetIncludedGroups(List<String> g)
           
 voidsetJunit(Boolean j)
           
 voidsetJUnit(Boolean isJUnit)
          Sets the JUnit compatibility flag.
 voidsetListeners(List<String> listeners)
           
 voidsetMethodSelectors(List<XmlMethodSelector> methodSelectors)
          Sets the method selectors.
 voidsetMethodSelectors(XmlMethodSelectors xms)
           
 voidsetName(String name)
          Sets the name.
 voidsetObjectFactory(ITestObjectFactory objectFactory)
           
 voidsetPackages(List<XmlPackage> packages)
           
 voidsetParallel(String parallel)
          Sets the parallel mode
 voidsetParameters(Map<String,String> parameters)
          Sets parameters.
 voidsetParentSuite(XmlSuite parentSuite)
           
 voidsetPreserveOrder(String f)
           
 voidsetSkipFailedInvocationCounts(boolean skip)
           
 voidsetSuiteFiles(List<String> files)
          Sets the suite files.
 voidsetTests(List<XmlTest> tests)
           
 voidsetThreadCount(int threadCount)
          Set the thread count.
 voidsetTimeOut(String timeOut)
          Sets the timeout.
 voidsetVerbose(Integer verbose)
          Set the verbose.
 voidsetXmlMethodSelectors(XmlMethodSelectors xms)
           
 voidsetXmlPackages(List<XmlPackage> packages)
          Sets the XML packages.
 BooleanskipFailedInvocationCounts()
           
 StringtoString()
          
 StringtoXml()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PARALLEL_TESTS

public static final String PARALLEL_TESTS
Parallel modes

See Also:
Constant Field Values


PARALLEL_METHODS

public static final String PARALLEL_METHODS
See Also:
Constant Field Values

PARALLEL_CLASSES

public static final String PARALLEL_CLASSES
See Also:
Constant Field Values

PARALLEL_INSTANCES

public static final String PARALLEL_INSTANCES
See Also:
Constant Field Values

PARALLEL_NONE

public static final String PARALLEL_NONE
See Also:
Constant Field Values

PARALLEL_MODES

public static Set<String> PARALLEL_MODES

SKIP

public static final String SKIP
Configuration failure policy options

See Also:
Constant Field Values


CONTINUE

public static final String CONTINUE
See Also:
Constant Field Values

DEFAULT_VERBOSE

public static Integer DEFAULT_VERBOSE
The suite verbose flag. (0 to 10)


DEFAULT_PARALLEL

public static String DEFAULT_PARALLEL

DEFAULT_CONFIG_FAILURE_POLICY

public static String DEFAULT_CONFIG_FAILURE_POLICY
Whether to SKIP or CONTINUE to re-attempt failed configuration methods.


DEFAULT_JUNIT

public static Boolean DEFAULT_JUNIT
JUnit compatibility flag.


DEFAULT_MIXED

public static Boolean DEFAULT_MIXED
mixed mode flag.


DEFAULT_SKIP_FAILED_INVOCATION_COUNTS

public static Boolean DEFAULT_SKIP_FAILED_INVOCATION_COUNTS

DEFAULT_THREAD_COUNT

public static Integer DEFAULT_THREAD_COUNT
The thread count.


DEFAULT_DATA_PROVIDER_THREAD_COUNT

public static final Integer DEFAULT_DATA_PROVIDER_THREAD_COUNT
Thread count for the data provider pool


DEFAULT_GROUP_BY_INSTANCES

public static final Boolean DEFAULT_GROUP_BY_INSTANCES
By default, a method failing will cause all instances of that class to skip


DEFAULT_ALLOW_RETURN_VALUES

public static Boolean DEFAULT_ALLOW_RETURN_VALUES

DEFAULT_PRESERVE_ORDER

public static String DEFAULT_PRESERVE_ORDER
Constructor Detail

XmlSuite

public XmlSuite()
Method Detail

getFileName

public String getFileName()
Returns:
the fileName

setFileName

public void setFileName(String fileName)
Parameters:
fileName - the fileName to set

getParallel

public String getParallel()
Returns the parallel mode.

Returns:
the parallel mode.

getObjectFactory

public ITestObjectFactory getObjectFactory()

setObjectFactory

public void setObjectFactory(ITestObjectFactory objectFactory)

setParallel

public void setParallel(String parallel)
Sets the parallel mode

Parameters:
parallel - the parallel mode

setConfigFailurePolicy

public void setConfigFailurePolicy(String configFailurePolicy)
Sets the configuration failure policy.

Parameters:
configFailurePolicy - the config failure policy

getConfigFailurePolicy

public String getConfigFailurePolicy()
Returns the configuration failure policy.

Returns:
the configuration failure policy

getVerbose

public Integer getVerbose()
Returns the verbose.

Returns:
the verbose.

setVerbose

public void setVerbose(Integer verbose)
Set the verbose.

Parameters:
verbose - The verbose to set.

getName

public String getName()
Returns the name.

Returns:
the name.

setName

public void setName(String name)
Sets the name.

Parameters:
name - The name to set.

getTest

public String getTest()
Returns the test.

Returns:
the test.

getTests

public List<XmlTest> getTests()
Returns the tests.

Returns:
the tests.

setTests

public void setTests(List<XmlTest> tests)

getMethodSelectors

public List<XmlMethodSelector> getMethodSelectors()
Returns the method selectors.

Returns:
the method selectors.

setMethodSelectors

public void setMethodSelectors(List<XmlMethodSelector> methodSelectors)
Sets the method selectors.

Parameters:
methodSelectors - the method selectors.

setParameters

public void setParameters(Map<String,String> parameters)
Sets parameters.

Parameters:
parameters - the parameters.

getParameters

public Map<String,String> getParameters()
Gets the parameters that apply to tests in this suite.
Set of parameters for a suite is appended with parameters from parent suite. Also, parameters from this suite override the same named parameters from parent suite.


getAllParameters

public Map<String,String> getAllParameters()
Returns:
The parameters defined in this suite and all its XmlTests.

getParameter

public String getParameter(String name)
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

public Boolean isJUnit()
Returns:
The JUnit compatibility flag.

setJUnit

public void setJUnit(Boolean isJUnit)
Sets the JUnit compatibility flag.

Parameters:
isJUnit - the JUnit compatibility flag.

setJunit

public void setJunit(Boolean j)

skipFailedInvocationCounts

public Boolean skipFailedInvocationCounts()

setSkipFailedInvocationCounts

public void setSkipFailedInvocationCounts(boolean skip)

setXmlPackages

public void setXmlPackages(List<XmlPackage> packages)
Sets the XML packages.

Parameters:
packages - the XML packages.

getXmlPackages

public List<XmlPackage> getXmlPackages()
Returns the XML packages.

Returns:
the XML packages.

getPackages

public List<XmlPackage> getPackages()

setMethodSelectors

public void setMethodSelectors(XmlMethodSelectors xms)

setPackages

public void setPackages(List<XmlPackage> packages)

toXml

public String toXml()
Returns:
A String representation of this XML suite.

setXmlMethodSelectors

public void setXmlMethodSelectors(XmlMethodSelectors xms)

toString

public String toString()

Overrides:
toString in class Object

clone

public Object clone()
Note that this is not a full clone: XmlTest children are not cloned by this method.

Overrides:
clone in class Object

setTimeOut

public void setTimeOut(String timeOut)
Sets the timeout.

Parameters:
timeOut - the timeout.

getTimeOut

public String 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 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

public void setSuiteFiles(List<String> files)
Sets the suite files.

Parameters:
files - the suite files.

getSuiteFiles

public List<String> getSuiteFiles()
Returns the suite files.

Returns:
the suite files.

setListeners

public void setListeners(List<String> listeners)

getListeners

public List<String> getListeners()

setDataProviderThreadCount

public void setDataProviderThreadCount(int count)

getDataProviderThreadCount

public int getDataProviderThreadCount()

setParentSuite

public void setParentSuite(XmlSuite parentSuite)

getParentSuite

public XmlSuite getParentSuite()

getChildSuites

public List<XmlSuite> getChildSuites()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

setPreserveOrder

public void setPreserveOrder(String f)

getPreserveOrder

public String getPreserveOrder()

getIncludedGroups

public List<String> getIncludedGroups()
Returns:
Returns the includedGroups. Note: do not modify the returned value, use addIncludedGroup(String).

addIncludedGroup

public void addIncludedGroup(String g)

setIncludedGroups

public void setIncludedGroups(List<String> g)
Parameters:
g -

setExcludedGroups

public void setExcludedGroups(List<String> g)
Parameters:
g - The excludedGrousps to set.

getExcludedGroups

public List<String> getExcludedGroups()
Returns:
Returns the excludedGroups. Note: do not modify the returned value, use addExcludedGroup(String).

addExcludedGroup

public void addExcludedGroup(String g)

getGroupByInstances

public Boolean getGroupByInstances()

setGroupByInstances

public void setGroupByInstances(boolean f)

addListener

public void addListener(String listener)

getAllowReturnValues

public Boolean getAllowReturnValues()

setAllowReturnValues

public void setAllowReturnValues(Boolean allowReturnValues)

setGroups

public void setGroups(XmlGroups xmlGroups)

onParameterElement

public void onParameterElement(String name,                               String value)

onListenerElement

public void onListenerElement(String className)

onSuiteFilesElement

public void onSuiteFilesElement(String path)

onPackagesElement

public void onPackagesElement(String name)

onMethodSelectorElement

public void onMethodSelectorElement(String language,                                    String name,                                    String priority)

getGroups

public XmlGroups getGroups()

addTest

public void addTest(XmlTest test)

getPackageNames

public Collection<String> getPackageNames()

isParallel

public static boolean isParallel(String parallel)


Copyright © 2012. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14