org.testng.xml
Class XmlSuite

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

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

Field Detail

JAVADOC

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

JDK5_ANNOTATION_TYPE

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


JAVADOC_ANNOTATION_TYPE

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


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_NONE

public static final String PARALLEL_NONE
See Also:
Constant Field Values

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_JUNIT

public static Boolean DEFAULT_JUNIT
JUnit compatibility 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 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 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 IObjectFactory getObjectFactory()

setObjectFactory

public void setObjectFactory(IObjectFactory 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.

setBeanShellExpression

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

Parameters:
expression - the bean shell expression.

getExpression

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

Returns the bean shell expression.

Returns:
the bean shell expression.

getBeanShellExpression

public String getBeanShellExpression()
Returns the bean shell expression.

Returns:
the bean shell expression.

setParameters

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

Parameters:
parameters - the parameters.

getParameters

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

Returns:
The parameters defined in this suite only.

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.

Returns:
the threadCount.

setThreadCount

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

Parameters:
threadCount - The thread count to set.

getAnnotations

public 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(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(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 Boolean isJUnit()
Returns the JUnit compatibility flag.

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()

setPackages

public void setPackages(List<XmlPackage> packages)

toXml

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

Returns:
a String representation of this XML suite.

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


Copyright © 2010. All Rights Reserved.