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 intDEFAULT_TIMEOUT_MS
           
 
Constructor Summary
XmlTest()
           
XmlTest(XmlSuite suite)
           
XmlTest(XmlSuite suite, int index)
          Constructs a XmlTest and adds it to suite's list of tests.
 
Method Summary
 voidaddExcludedGroup(String g)
           
 voidaddIncludedGroup(String g)
           
 voidaddMetaGroup(String name, List<String> metaGroup)
           
 voidaddParameter(String key, String value)
           
 voidaddXmlDependencyGroup(String group, String dependsOn)
           
 Objectclone()
          Clone the source XmlTest by including: - test attributes - groups definitions - parameters The <classes> sub element is ignored for the moment.
 booleanequals(Object obj)
           
 BooleangetAllowReturnValues()
           
 Map<String,String>getAllParameters()
           
 List<XmlClass>getClasses()
           
 List<String>getExcludedGroups()
           
 StringgetExpression()
           
 booleangetGroupByInstances()
           
 List<String>getIncludedGroups()
           
 intgetIndex()
          Note that this attribute does not come from the XML file, it's calculated internally and represents the order in which this test tag was found in its <suite> tag.
 List<Integer>getInvocationNumbers(String method)
          Convenience method to cache the ordering numbers for methods.
 Map<String,String>getLocalParameters()
           
 Map<String,List<String>>getMetaGroups()
           
 List<XmlMethodSelector>getMethodSelectors()
           
 StringgetName()
           
 List<XmlPackage>getPackages()
           
 StringgetParallel()
           
 StringgetParameter(String name)
           
 Map<String,String>getParameters()
          Deprecated. Use getLocalParameters() or getAllParameters()
 StringgetPreserveOrder()
           
 XmlSuitegetSuite()
          Returns the suite this test is part of.
 Map<String,String>getTestParameters()
           
 intgetThreadCount()
           
 StringgetTimeOut()
           
 longgetTimeOut(long def)
           
 intgetVerbose()
           
 List<XmlClass>getXmlClasses()
           
 Map<String,String>getXmlDependencyGroups()
           
 List<XmlPackage>getXmlPackages()
           
 inthashCode()
           
 booleanisJUnit()
           
 voidsetAllowReturnValues(Boolean allowReturnValues)
           
 voidsetBeanShellExpression(String expression)
           
 voidsetClasses(List<XmlClass> c)
           
 voidsetClassNames(List<XmlClass> classes)
          Deprecated. use setXmlClasses
 voidsetExcludedGroups(List<String> g)
           
 voidsetExpression(String expression)
           
 voidsetGroupByInstances(boolean f)
           
 voidsetGroups(XmlGroups xmlGroups)
           
 voidsetIncludedGroups(List<String> g)
           
 voidsetJunit(boolean isJUnit)
           
 voidsetJUnit(boolean isJUnit)
           
 voidsetMetaGroups(Map<String,List<String>> metaGroups)
           
 voidsetMethodSelectors(List<XmlMethodSelector> methodSelectors)
           
 voidsetName(String name)
           
 voidsetPackages(List<XmlPackage> p)
           
 voidsetParallel(String parallel)
           
 voidsetParameters(Map<String,String> parameters)
           
 voidsetPreserveOrder(String preserveOrder)
           
 voidsetSkipFailedInvocationCounts(boolean skip)
           
 voidsetSuite(XmlSuite result)
           
 voidsetThreadCount(int threadCount)
           
 voidsetTimeOut(long timeOut)
           
 voidsetVerbose(int v)
           
 voidsetXmlClasses(List<XmlClass> classes)
          Sets the XML Classes.
 voidsetXmlPackages(List<XmlPackage> packages)
           
 voidsetXmlSuite(XmlSuite suite)
           
 booleanskipFailedInvocationCounts()
           
 StringtoString()
           
 StringtoXml(String indent)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT_MS

public static int DEFAULT_TIMEOUT_MS
Constructor Detail

XmlTest

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

Parameters:
suite - the parent suite.
index - the index of this test tag in testng.xml


XmlTest

public XmlTest(XmlSuite suite)

XmlTest

public XmlTest()
Method Detail

setXmlPackages

public void setXmlPackages(List<XmlPackage> packages)

getXmlPackages

public List<XmlPackage> getXmlPackages()

getPackages

public List<XmlPackage> getPackages()

setPackages

public void setPackages(List<XmlPackage> p)

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:
the includedGroups. Note: do not modify the returned value, use addIncludedGroup(String).

setClassNames

@Deprecatedpublic 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.

getClasses

public List<XmlClass> getClasses()

setClasses

public void setClasses(List<XmlClass> c)

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. Note: do not modify the returned value, use addExcludedGroup(String).

addIncludedGroup

public void addIncludedGroup(String g)

addExcludedGroup

public void addExcludedGroup(String g)

getVerbose

public int getVerbose()
Returns:
Returns the verbose.

getGroupByInstances

public boolean getGroupByInstances()

setGroupByInstances

public void setGroupByInstances(boolean f)

isJUnit

public boolean isJUnit()
Returns:
Returns the isJUnit.

setJUnit

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

setJunit

public void setJunit(boolean isJUnit)

setSkipFailedInvocationCounts

public void setSkipFailedInvocationCounts(boolean skip)

skipFailedInvocationCounts

public boolean skipFailedInvocationCounts()
Returns:
Returns the isJUnit.

addMetaGroup

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

setMetaGroups

public void setMetaGroups(Map<String,List<String>> metaGroups)

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)

getAllParameters

public Map<String,String> getAllParameters()
Returns:
the parameters defined in this test tag and the tags above it.

getLocalParameters

public Map<String,String> getLocalParameters()
Returns:
the parameters defined in this tag, and only this test tag. To retrieve the inherited parameters as well, call getAllParameters().

getParameters

@Deprecatedpublic Map<String,String> getParameters()
Deprecated. Use getLocalParameters() or getAllParameters()


getTestParameters

public Map<String,String> getTestParameters()
Returns:
the parameters defined on this tag only

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)

setExpression

public void setExpression(String expression)

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

setSuite

public void setSuite(XmlSuite result)

getAllowReturnValues

public Boolean getAllowReturnValues()

setAllowReturnValues

public void setAllowReturnValues(Boolean allowReturnValues)

getIndex

public int getIndex()
Note that this attribute does not come from the XML file, it's calculated internally and represents the order in which this test tag was found in its <suite> tag. It's used to calculate the ordering of the tests when preserve-test-order is true.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

addXmlDependencyGroup

public void addXmlDependencyGroup(String group,                                  String dependsOn)

getXmlDependencyGroups

public Map<String,String> getXmlDependencyGroups()

setXmlSuite

public void setXmlSuite(XmlSuite suite)

setGroups

public void setGroups(XmlGroups xmlGroups)


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