Top Description Inners Fields Constructors Methods
org.testng

public Class TestRunner

extends Object
implements ITestContext, ITestResultNotifier, IThreadWorkerFactory<ITestNGMethod>, IConfigEavesdropper
Class Inheritance
All Implemented Interfaces
org.testng.internal.IConfigEavesdropper, org.testng.thread.IThreadWorkerFactory, org.testng.internal.ITestResultNotifier, org.testng.ITestContext, org.testng.IAttributes
Static Imports
org.testng.ListenerComparator.sort, org.testng.internal.MethodHelper.fixMethodsWithClass

This class takes care of running one Test.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
public static enum

Field Summary

Modifier and TypeField and Description
private final Comparator<ITestNGMethod>
private static final String
private ITestListener
private final DataProviderHolder
private ITestNGMethod[]
private ITestNGMethod[]
private IAnnotationFinder
private final IAttributes
private ITestNGMethod[]
private ITestNGMethod[]
private final Map<Class<? extends IClassListener>, IClassListener>
private final Map<Class<?>, ITestClass>
m_classMap

A map to keep track of Class <-> IClass.

private ClassMethodMap
private final IResultMap
private IConfiguration
private final Set<IConfigurationListener>
private final IConfigurationListener
private Date
private final List<ITestNGMethod>
private final IResultMap
private final IResultMap
private final IResultMap
private ConfigurationGroupMethods
private String
private IInjectorFactory
private IInvoker
private final Map<String, List<String>>
private List<IMethodInterceptor>
private ITestObjectFactory
private String
m_outputDirectory

Where the reports will be created.

private final IResultMap
private final IResultMap
private final RunInfo
private final IResultMap
private final IResultMap
private Date
private ISuite
private List<XmlClass>
private TestNGClassFinder
private final List<ITestListener>
m_testListeners

ITestListeners support.

private String
private final XmlMethodSelector
private XmlTest
private final IContainer<ITestNGMethod>
private final Set<IExecutionVisualiser>

Constructor Summary

AccessConstructor and Description
protected
TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, String outputDirectory, IAnnotationFinder finder, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, Comparator<ITestNGMethod> comparator, DataProviderHolder otherHolder, ISuiteRunnerListener suiteRunner)

public
TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, Comparator<ITestNGMethod> comparator, ISuiteRunnerListener suiteRunner)

public
TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, ISuiteRunnerListener suiteRunner)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
public void
public void
private void
addMetaGroup(String name, List<String> groupNames)

pack-priv void
public void
public void
pack-priv void
private static ITestNGMethod[]
private void
private static ITestNGMethod[]
private void
beforeRun()

Before run preparements.

private ITestNGMethod[]
private Map<String, String>
public List<IWorker<ITestNGMethod>>
createWorkers(List<ITestNGMethod>
tasks that need to be executed
methods
)

Implements org.testng.thread.IThreadWorkerFactory.createWorkers.

Create a list of workers to run the methods passed in parameter.
private void
private void
fireEvent(boolean
true if the event is for start, false if the event is for finish
isStart
)

Trigger the start/finish event.

private void
public ITestNGMethod[]
public ITestNGMethod[]
private List<XmlPackage>
getAllPackages()

Returns all packages to use for the current test.

public ITestNGMethod[]
public Object
getAttribute(String
The name of the attribute to return
name
)

Implements org.testng.IAttributes.getAttribute.

public Set<String>
public ITestNGMethod[]
public ITestNGMethod[]
public List<IConfigurationListener>
public IResultMap
public XmlTest
public Date

Returns:

Returns the endDate.
getEndDate
()

Implements org.testng.ITestContext.getEndDate.

public String[]
public Collection<ITestNGMethod>
public ITestListener
public IResultMap
public IResultMap
public IResultMap
public Set<ITestResult>
public String
public String[]
public IInjectorFactory
public IInvoker
public String
public String
public IResultMap
public IResultMap
public Set<ITestResult>
public IResultMap
public IResultMap
public Set<ITestResult>
public Date

Returns:

Returns the startDate.
getStartDate
()

Implements org.testng.ITestContext.getStartDate.

public ISuite

Returns:

Returns the suite.
getSuite
()

Implements org.testng.ITestContext.getSuite.

public XmlTest
public Collection<ITestClass>
public List<ITestListener>
public static int
private void
init(IConfiguration configuration, ISuite suite, XmlTest test, String outputDirectory, IAnnotationFinder annotationFinder, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, ISuiteRunnerListener suiteRunner)

private void
init()

private void
private void
initMetaGroups(XmlTest xmlTest)

Initialize meta groups

private void
private void
initRunInfo(final XmlTest xmlTest)

private ITestNGMethod[]
intercept(ITestNGMethod[] methods)

Apply the method interceptor (if applicable) to the list of methods.

private void
invokeTestConfigurations(ITestNGMethod[] testConfigurationMethods)

private static void
private void
logFailedTest(ITestResult tr, boolean withinSuccessPercentage)

private void
logStart()

Logs the beginning of the beforeRun() .

private static Stream<Method>
methods(IResultMap resultMap)

private static Stream<Method>
private static Comparator<ITestNGMethod>
newComparator(boolean needPrioritySort)

private static BlockingQueue<Runnable>
newQueue(boolean needPrioritySort)

private void
privateRun(XmlTest xmlTest)

Main method that create a graph of methods and then pass it to the graph executor to run them.

public Object
removeAttribute(String
The attribute name
name
)

Implements org.testng.IAttributes.removeAttribute.

Remove the attribute
public void
run()

The main entry method for TestRunner.

public void
setAttribute(String
The attribute name
name
,
Object
The attribute value
value
)

Implements org.testng.IAttributes.setAttribute.

Set a custom attribute.
private void
public void
public void
public void
setVerbose(int n)

private boolean
sortOnPriority(ITestNGMethod[] interceptedOrder)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait