org.testng.xml
Class XmlTest

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

public class XmlTest
extends Object
implements Serializable, Cloneable

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

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

Field Summary
static int DEFAULT_TIMEOUT_MS
           
 
Constructor Summary
XmlTest(XmlSuite suite)
          Constructs a XmlTest and adds it to suite's list of tests.
 
Method Summary
 void addMetaGroup(String name, List<String> metaGroup)
           
 void addParameter(String key, String value)
           
 Object clone()
          Clone the source XmlTest by including: - test attributes - groups definitions - parameters The <classes> sub element is ignored for the moment.
 String getAnnotations()
           
 List<String> getExcludedGroups()
           
 String getExpression()
           
 List<String> getIncludedGroups()
           
 List<Integer> getInvocationNumbers(String method)
          Convenience method to cache the ordering numbers for methods.
 Map<String,List<String>> getMetaGroups()
           
 List<XmlMethodSelector> getMethodSelectors()
           
 String getName()
           
 String getParallel()
           
 String getParameter(String name)
           
 Map<String,String> getParameters()
          Returns a merge of the the test parameters and its parent suite parameters.
 String getPreserveOrder()
           
 XmlSuite getSuite()
          Returns the suite this test is part of.
 int getThreadCount()
           
 String getTimeOut()
           
 long getTimeOut(long def)
           
 int getVerbose()
           
 List<XmlClass> getXmlClasses()
           
 List<XmlPackage> getXmlPackages()
           
 boolean isJUnit()
           
 void setAnnotations(String annotations)
           
 void setBeanShellExpression(String expression)
           
 void setClassNames(List<XmlClass> classes)
          Deprecated. use setXmlClasses
 void setExcludedGroups(List<String> g)
           
 void setIncludedGroups(List<String> g)
           
 void setJUnit(boolean isJUnit)
           
 void setMethodSelectors(List<XmlMethodSelector> methodSelectors)
           
 void setName(String name)
           
 void setParallel(String parallel)
           
 void setParameters(Map<String,String> parameters)
           
 void setPreserveOrder(String preserveOrder)
           
 void setSkipFailedInvocationCounts(boolean skip)
           
 void setThreadCount(int threadCount)
           
 void setTimeOut(long timeOut)
           
 void setVerbose(int v)
           
 void setXmlClasses(List<XmlClass> classes)
          Sets the XML Classes.
 void setXmlPackages(List<XmlPackage> packages)
           
 boolean skipFailedInvocationCounts()
           
 String toString()
           
 String toXml(String indent)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT_MS

public static int DEFAULT_TIMEOUT_MS
Constructor Detail

XmlTest

public XmlTest(XmlSuite suite)
Constructs a XmlTest and adds it to suite's list of tests.

Parameters:
suite - the parent suite.
Method Detail

setXmlPackages

public void setXmlPackages(List<XmlPackage> packages)

getXmlPackages

public List<XmlPackage> getXmlPackages()

getMethodSelectors

public List<XmlMethodSelector> getMethodSelectors()

setMethodSelectors

public void setMethodSelectors(List<XmlMethodSelector> methodSelectors)

getSuite

public XmlSuite getSuite()
Returns the suite this test is part of.

Returns:
the suite this test is part of.

getIncludedGroups

public List<String> getIncludedGroups()
Returns:
Returns the includedGroups.

setClassNames

@Deprecated
public void setClassNames(List<XmlClass> classes)
Deprecated. use setXmlClasses

Sets the XML Classes.

Parameters:
classes - The classes to set.

getXmlClasses

public List<XmlClass> getXmlClasses()
Returns:
Returns the classes.

setXmlClasses

public void setXmlClasses(List<XmlClass> classes)
Sets the XML Classes.

Parameters:
classes - The classes to set.

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

setVerbose

public void setVerbose(int v)
Parameters:
v -

getThreadCount

public int getThreadCount()

setThreadCount

public void setThreadCount(int threadCount)

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.

getVerbose

public int getVerbose()
Returns:
Returns the verbose.

isJUnit

public boolean isJUnit()
Returns:
Returns the isJUnit.

setJUnit

public void setJUnit(boolean isJUnit)
Parameters:
isJUnit - The isJUnit to set.

setSkipFailedInvocationCounts

public void setSkipFailedInvocationCounts(boolean skip)

skipFailedInvocationCounts

public boolean skipFailedInvocationCounts()
Returns:
Returns the isJUnit.

addMetaGroup

public void addMetaGroup(String name,
                         List<String> metaGroup)

getMetaGroups

public Map<String,List<String>> getMetaGroups()
Returns:
Returns the metaGroups.

setParameters

public void setParameters(Map<String,String> parameters)
Parameters:
parameters -

addParameter

public void addParameter(String key,
                         String value)

getParameter

public String getParameter(String name)

getParameters

public Map<String,String> getParameters()
Returns a merge of the the test parameters and its parent suite parameters. Test parameters have precedence over suite parameters.

Returns:
a merge of the the test parameters and its parent suite parameters.

setParallel

public void setParallel(String parallel)

getParallel

public String getParallel()

getTimeOut

public String getTimeOut()

getTimeOut

public long getTimeOut(long def)

setTimeOut

public void setTimeOut(long timeOut)

getAnnotations

public String getAnnotations()

setAnnotations

public void setAnnotations(String annotations)

setBeanShellExpression

public void setBeanShellExpression(String expression)

getExpression

public String getExpression()

toXml

public String toXml(String indent)

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
Clone the source XmlTest by including: - test attributes - groups definitions - parameters The <classes> sub element is ignored for the moment.

Overrides:
clone in class Object
Returns:
a clone of the current XmlTest

getInvocationNumbers

public List<Integer> getInvocationNumbers(String method)
Convenience method to cache the ordering numbers for methods.


setPreserveOrder

public void setPreserveOrder(String preserveOrder)

getPreserveOrder

public String getPreserveOrder()


Copyright © 2010. All Rights Reserved.