package org.testng;

import com.google.inject.Injector;
import com.google.inject.Module;

import org.testng.internal.ClassImpl;
import org.testng.xml.XmlTest;

import java.util.Collection;
import java.util.Date;
import java.util.List;


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
/** * 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 */
public interface ITestContext extends IAttributes {
The name of this test.
/** * The name of this test. */
public String getName();
When this test started running.
/** * When this test started running. */
public Date getStartDate();
When this test stopped running.
/** * When this test stopped running. */
public Date getEndDate();
Returns:A list of all the tests that run successfully.
/** * @return A list of all the tests that run successfully. */
public IResultMap getPassedTests();
Returns:A list of all the tests that were skipped
/** * @return A list of all the tests that were skipped */
public IResultMap getSkippedTests();
Returns:A list of all the tests that failed but are being ignored because annotated with a successPercentage.
/** * @return A list of all the tests that failed but are being ignored because * annotated with a successPercentage. */
public IResultMap getFailedButWithinSuccessPercentageTests();
See Also:
Returns:A map of all the tests that passed, indexed by their ITextMethor.
/** * @return A map of all the tests that passed, indexed by * their ITextMethor. * * @see org.testng.ITestNGMethod */
public IResultMap getFailedTests();
Returns:All the groups that are included for this test run.
/** * @return All the groups that are included for this test run. */
public String[] getIncludedGroups();
Returns:All the groups that are excluded for this test run.
/** * @return All the groups that are excluded for this test run. */
public String[] getExcludedGroups();
Returns:Where the reports will be generated.
/** * @return Where the reports will be generated. */
public String getOutputDirectory();
Returns:The Suite object that was passed to the runner at start-up.
/** * @return The Suite object that was passed to the runner * at start-up. */
public ISuite getSuite();
Returns:All the test methods that were run.
/** * @return All the test methods that were run. */
public ITestNGMethod[] getAllTestMethods();
Returns:The host where this test was run, or null if it was run locally. The returned string has the form: host:port
/** * @return The host where this test was run, or null if it was run locally. The * returned string has the form: host:port */
public String getHost();
Returns:All the methods that were not included in this test run.
/** * @return All the methods that were not included in this test run. */
public Collection<ITestNGMethod> getExcludedMethods();
Retrieves information about the successful configuration method invocations.
/** * Retrieves information about the successful configuration method invocations. */
public IResultMap getPassedConfigurations();
Retrieves information about the skipped configuration method invocations.
/** * Retrieves information about the skipped configuration method invocations. */
public IResultMap getSkippedConfigurations();
Retrieves information about the failed configuration method invocations.
/** * Retrieves information about the failed configuration method invocations. */
public IResultMap getFailedConfigurations();
Returns:the current XmlTest.
/** * @return the current XmlTest. */
public XmlTest getCurrentXmlTest(); public List<Module> getGuiceModules(Class<? extends Module> cls); public Injector getInjector(List<Module> moduleInstances); Injector getInjector(IClass iClass); public void addInjector(List<Module> moduleInstances, Injector injector); }