Top Description Methods
org.testng

public Interface ITestContext

extends IAttributes
Known Direct Implementers
org.testng.TestRunner
Imports
java.util.Collection, .Date, org.testng.xml.XmlTest

This class defines a test context which contains all the information for a given test run. An instance of this context is passed to the test listeners so they can query information about their environment.
Author
Cedric Beust, Aug 6, 2004

Method Summary

Modifier and TypeMethod and Description
public ITestNGMethod[]

Returns:

All the test methods that were run.
getAllTestMethods
()

public XmlTest

Returns:

the current XmlTest.
getCurrentXmlTest
()

public Date

Returns:

When this test stopped running.
getEndDate
()

public String[]

Returns:

All the groups that are excluded for this test run.
getExcludedGroups
()

public Collection<ITestNGMethod>

Returns:

All the methods that were not included in this test run.
getExcludedMethods
()

public IResultMap

Returns:

A list of all the tests that failed but are being ignored because annotated with a successPercentage.
getFailedButWithinSuccessPercentageTests
()

public IResultMap

Returns:

The information about the failed configuration method invocations.
getFailedConfigurations
()

public IResultMap

Returns:

A map of all the tests that failed, indexed by their ITestNGMethod.
getFailedTests
()

public String

Returns:

The host where this test was run, or null if it was run locally. The returned string has the form: host:port
getHost
()

public String[]

Returns:

All the groups that are included for this test run.
getIncludedGroups
()

public default IInjectorFactory
public String

Returns:

The name of this test.
getName
()

public String

Returns:

Where the reports will be generated.
getOutputDirectory
()

public IResultMap

Returns:

The information about the successful configuration method invocations.
getPassedConfigurations
()

public IResultMap

Returns:

A list of all the tests that run successfully.
getPassedTests
()

public IResultMap

Returns:

The information about the skipped configuration method invocations.
getSkippedConfigurations
()

public IResultMap

Returns:

A list of all the tests that were skipped
getSkippedTests
()

public Date

Returns:

When this test started running.
getStartDate
()

public ISuite

Returns:

The Suite object that was passed to the runner at start-up.
getSuite
()

Inherited from org.testng.IAttributes:
getAttributegetAttributeNamesremoveAttributesetAttribute

Method Detail

getAllTestMethodsback to summary
public ITestNGMethod[] getAllTestMethods()
Returns:ITestNGMethod[]

All the test methods that were run.

getCurrentXmlTestback to summary
public XmlTest getCurrentXmlTest()
Returns:XmlTest

the current XmlTest.

getEndDateback to summary
public Date getEndDate()
Returns:Date

When this test stopped running.

getExcludedGroupsback to summary
public String[] getExcludedGroups()
Returns:String[]

All the groups that are excluded for this test run.

getExcludedMethodsback to summary
public Collection<ITestNGMethod> getExcludedMethods()
Returns:Collection<ITestNGMethod>

All the methods that were not included in this test run.

getFailedButWithinSuccessPercentageTestsback to summary
public IResultMap getFailedButWithinSuccessPercentageTests()
Returns:IResultMap

A list of all the tests that failed but are being ignored because annotated with a successPercentage.

getFailedConfigurationsback to summary
public IResultMap getFailedConfigurations()
Returns:IResultMap

The information about the failed configuration method invocations.

getFailedTestsback to summary
public IResultMap getFailedTests()
Returns:IResultMap

A map of all the tests that failed, indexed by their ITestNGMethod.

See Also
org.testng.ITestNGMethod
getHostback to summary
public String getHost()
Returns:String

The host where this test was run, or null if it was run locally. The returned string has the form: host:port

getIncludedGroupsback to summary
public String[] getIncludedGroups()
Returns:String[]

All the groups that are included for this test run.

getInjectorFactoryback to summary
public default IInjectorFactory getInjectorFactory()
getNameback to summary
public String getName()
Returns:String

The name of this test.

getOutputDirectoryback to summary
public String getOutputDirectory()
Returns:String

Where the reports will be generated.

getPassedConfigurationsback to summary
public IResultMap getPassedConfigurations()
Returns:IResultMap

The information about the successful configuration method invocations.

getPassedTestsback to summary
public IResultMap getPassedTests()
Returns:IResultMap

A list of all the tests that run successfully.

getSkippedConfigurationsback to summary
public IResultMap getSkippedConfigurations()
Returns:IResultMap

The information about the skipped configuration method invocations.

getSkippedTestsback to summary
public IResultMap getSkippedTests()
Returns:IResultMap

A list of all the tests that were skipped

getStartDateback to summary
public Date getStartDate()
Returns:Date

When this test started running.

getSuiteback to summary
public ISuite getSuite()
Returns:ISuite

The Suite object that was passed to the runner at start-up.