org.testng.xml
Class XmlSuite

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

public class XmlSuite
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

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

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

Field Summary
static int DEFAULT_DATA_PROVIDER_THREAD_COUNT
          Thread count for the data provider pool
static java.lang.String JAVADOC
          Deprecated. use JAVADOC_ANNOTATION_TYPE.
static java.lang.String JAVADOC_ANNOTATION_TYPE
          The JavaDoc annotation type ID ("javadoc").
static java.lang.String JDK5_ANNOTATION_TYPE
          The JDK50 annotation type ID ("JDK5").
static java.lang.String PARALLEL_CLASSES
           
static java.lang.String PARALLEL_METHODS
           
static java.lang.String PARALLEL_NONE
           
static java.lang.String PARALLEL_TESTS
          Parallel modes
 
Constructor Summary
XmlSuite()
           
 
Method Summary
 java.lang.Object clone()
           Note that this is not a full clone: XmlTest children are not cloned by this method.
 java.util.Map<java.lang.String,java.lang.String> getAllParameters()
          Returns the parameters defined in this suite and all its XmlTests.
 java.lang.String getAnnotations()
          Returns the annotation type for the suite.
 java.lang.String getBeanShellExpression()
          Returns the bean shell expression.
 int getDataProviderThreadCount()
           
 java.lang.String getExpression()
          Deprecated. use getBeanShelltExpression()
 java.lang.String getFileName()
           
 java.util.List<java.lang.String> getListeners()
           
 java.util.List<XmlMethodSelector> getMethodSelectors()
          Returns the method selectors.
 java.lang.String getName()
          Returns the name.
 IObjectFactory getObjectFactory()
           
 java.lang.String getParallel()
          Returns the parallel mode.
 java.lang.String getParameter(java.lang.String name)
          Returns the parameter defined in this suite only.
 java.util.Map<java.lang.String,java.lang.String> getParameters()
          Returns the parameters defined in this suite only.
 java.util.List<java.lang.String> getSuiteFiles()
          Returns the suite files.
 java.lang.String getTest()
          Returns the test.
 java.util.List<XmlTest> getTests()
          Returns the tests.
 int getThreadCount()
          Returns the threadCount.
 java.lang.String getTimeOut()
          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.
 java.lang.Integer getVerbose()
          Returns the verbose.
 java.util.List<XmlPackage> getXmlPackages()
          Returns the XML packages.
 java.lang.Boolean isJUnit()
          Returns the JUnit compatibility flag.
 void setAnnotations(java.lang.String annotations)
          Sets the annotation type for the suite.
 void setBeanShellExpression(java.lang.String expression)
          Sets the bean shell expression.
 void setDataProviderThreadCount(int count)
           
 void setDefaultAnnotations(java.lang.String annotationType)
          Sets the overall default annotation type (JDK5/javadoc).
 void setFileName(java.lang.String fileName)
           
 void setJUnit(java.lang.Boolean isJUnit)
          Sets the JUnit compatibility flag.
 void setListeners(java.util.List<java.lang.String> listeners)
           
 void setMethodSelectors(java.util.List<XmlMethodSelector> methodSelectors)
          Sets the method selectors.
 void setName(java.lang.String name)
          Sets the name.
 void setObjectFactory(IObjectFactory objectFactory)
           
 void setParallel(java.lang.String parallel)
          Sets the parallel mode
 void setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
          Sets parameters.
 void setSkipFailedInvocationCounts(boolean skip)
           
 void setSuiteFiles(java.util.List<java.lang.String> files)
          Sets the suite files.
 void setThreadCount(int threadCount)
          Set the thread count.
 void setTimeOut(java.lang.String timeOut)
          Sets the timeout.
 void setVerbose(java.lang.Integer verbose)
          Set the verbose.
 void setXmlPackages(java.util.List<XmlPackage> packages)
          Sets the XML packages.
 java.lang.Boolean skipFailedInvocationCounts()
           
 java.lang.String toString()
          
 java.lang.String toXml()
          Returns a String representation of this XML suite.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JAVADOC

@Deprecated
public static final java.lang.String JAVADOC
Deprecated. use JAVADOC_ANNOTATION_TYPE.
See Also:
Constant Field Values

JDK5_ANNOTATION_TYPE

public static final java.lang.String JDK5_ANNOTATION_TYPE
The JDK50 annotation type ID ("JDK5").


JAVADOC_ANNOTATION_TYPE

public static final java.lang.String JAVADOC_ANNOTATION_TYPE
The JavaDoc annotation type ID ("javadoc").


PARALLEL_TESTS

public static final java.lang.String PARALLEL_TESTS
Parallel modes

See Also:
Constant Field Values

PARALLEL_METHODS

public static final java.lang.String PARALLEL_METHODS
See Also:
Constant Field Values

PARALLEL_CLASSES

public static final java.lang.String PARALLEL_CLASSES
See Also:
Constant Field Values

PARALLEL_NONE

public static final java.lang.String PARALLEL_NONE
See Also:
Constant Field Values

DEFAULT_DATA_PROVIDER_THREAD_COUNT

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

See Also:
Constant Field Values
Constructor Detail

XmlSuite

public XmlSuite()
Method Detail

getFileName

public java.lang.String getFileName()
Returns:
the fileName

setFileName

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

getParallel

public java.lang.String getParallel()
Returns the parallel mode.

Returns:
the parallel mode.

getObjectFactory

public IObjectFactory getObjectFactory()

setObjectFactory

public void setObjectFactory(IObjectFactory objectFactory)

setParallel

public void setParallel(java.lang.String parallel)
Sets the parallel mode

Parameters:
parallel - the parallel mode

getVerbose

public java.lang.Integer getVerbose()
Returns the verbose.

Returns:
the verbose.

setVerbose

public void setVerbose(java.lang.Integer verbose)
Set the verbose.

Parameters:
verbose - The verbose to set.

getName

public java.lang.String getName()
Returns the name.

Returns:
the name.

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - The name to set.

getTest

public java.lang.String getTest()
Returns the test.

Returns:
the test.

getTests

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

Returns:
the tests.

getMethodSelectors

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

Returns:
the method selectors.

setMethodSelectors

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

Parameters:
methodSelectors - the method selectors.

setBeanShellExpression

public void setBeanShellExpression(java.lang.String expression)
Sets the bean shell expression.

Parameters:
expression - the bean shell expression.

getExpression

@Deprecated
public java.lang.String getExpression()
Deprecated. use getBeanShelltExpression()

Returns the bean shell expression.

Returns:
the bean shell expression.

getBeanShellExpression

public java.lang.String getBeanShellExpression()
Returns the bean shell expression.

Returns:
the bean shell expression.

setParameters

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

Parameters:
parameters - the parameters.

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()
Returns the parameters defined in this suite only.

Returns:
The parameters defined in this suite only.

getAllParameters

public java.util.Map<java.lang.String,java.lang.String> getAllParameters()
Returns the parameters defined in this suite and all its XmlTests.

Returns:
The parameters defined in this suite and all its XmlTests.

getParameter

public java.lang.String getParameter(java.lang.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.

Returns:
the threadCount.

setThreadCount

public void setThreadCount(int threadCount)
Set the thread count.

Parameters:
threadCount - The thread count to set.

getAnnotations

public java.lang.String getAnnotations()
Returns the annotation type for the suite. If an annotation type has not been explicitly set, the default annotation type is returned.

Returns:
the annotation type for the suite.

setDefaultAnnotations

public void setDefaultAnnotations(java.lang.String annotationType)
Sets the overall default annotation type (JDK5/javadoc). It is used if the annotation attribute of the suite definition does not specify an explicit value.

Parameters:
annotationType - one of the two string constant JAVADOC_ANNOTATION_TYPE or JDK5_ANNOTATION_TYPE.
See Also:
JAVADOC_ANNOTATION_TYPE, JDK5_ANNOTATION_TYPE

setAnnotations

public void setAnnotations(java.lang.String annotations)
Sets the annotation type for the suite. If this value is not explicitly set, the suite annotation type defaults to the default annotation type. see setDefaultAnnotations

Parameters:
annotations - one of the two string constant JAVADOC_ANNOTATION_TYPE or JDK5_ANNOTATION_TYPE.
See Also:
JAVADOC_ANNOTATION_TYPE, JDK5_ANNOTATION_TYPE

isJUnit

public java.lang.Boolean isJUnit()
Returns the JUnit compatibility flag.

Returns:
the JUnit compatibility flag.

setJUnit

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

Parameters:
isJUnit - the JUnit compatibility flag.

skipFailedInvocationCounts

public java.lang.Boolean skipFailedInvocationCounts()

setSkipFailedInvocationCounts

public void setSkipFailedInvocationCounts(boolean skip)

setXmlPackages

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

Parameters:
packages - the XML packages.

getXmlPackages

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

Returns:
the XML packages.

toXml

public java.lang.String toXml()
Returns a String representation of this XML suite.

Returns:
a String representation of this XML suite.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

clone

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

Overrides:
clone in class java.lang.Object

setTimeOut

public void setTimeOut(java.lang.String timeOut)
Sets the timeout.

Parameters:
timeOut - the timeout.

getTimeOut

public java.lang.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(java.util.List<java.lang.String> files)
Sets the suite files.

Parameters:
files - the suite files.

getSuiteFiles

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

Returns:
the suite files.

setListeners

public void setListeners(java.util.List<java.lang.String> listeners)

getListeners

public java.util.List<java.lang.String> getListeners()

setDataProviderThreadCount

public void setDataProviderThreadCount(int count)

getDataProviderThreadCount

public int getDataProviderThreadCount()