public class TestRunner extends java.lang.Object implements ITestContext, org.testng.internal.ITestResultNotifier, IThreadWorkerFactory<ITestNGMethod>, org.testng.internal.IConfigEavesdropper
Modifier and Type | Class and Description |
---|---|
static class |
TestRunner.PriorityWeight |
Modifier | Constructor and Description |
---|---|
|
TestRunner(org.testng.internal.IConfiguration configuration,
ISuite suite,
XmlTest test,
boolean skipFailedInvocationCounts,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
java.util.List<IClassListener> classListeners) |
|
TestRunner(org.testng.internal.IConfiguration configuration,
ISuite suite,
XmlTest test,
boolean skipFailedInvocationCounts,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
java.util.List<IClassListener> classListeners,
java.util.Comparator<ITestNGMethod> comparator) |
protected |
TestRunner(org.testng.internal.IConfiguration configuration,
ISuite suite,
XmlTest test,
java.lang.String outputDirectory,
org.testng.internal.annotations.IAnnotationFinder finder,
boolean skipFailedInvocationCounts,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
java.util.List<IClassListener> classListeners,
java.util.Comparator<ITestNGMethod> comparator,
DataProviderHolder otherHolder) |
Modifier and Type | Method and Description |
---|---|
void |
addFailedButWithinSuccessPercentageTest(ITestNGMethod testMethod,
ITestResult result) |
void |
addFailedTest(ITestNGMethod testMethod,
ITestResult result) |
void |
addGuiceModule(com.google.inject.Module module)
This method stands deprecated as of TestNG
7.3.0 |
void |
addInjector(java.util.List<com.google.inject.Module> moduleInstances,
com.google.inject.Injector injector)
This method stands deprecated as of TestNG
7.3.0 |
void |
addListener(ITestNGListener listener) |
void |
addPassedTest(ITestNGMethod tm,
ITestResult tr) |
void |
addSkippedTest(ITestNGMethod tm,
ITestResult tr) |
java.util.List<IWorker<ITestNGMethod>> |
createWorkers(java.util.List<ITestNGMethod> methods)
Create a list of workers to run the methods passed in parameter.
|
ITestNGMethod[] |
getAfterSuiteMethods() |
ITestNGMethod[] |
getAfterTestConfigurationMethods() |
java.util.List<com.google.inject.Module> |
getAllGuiceModules()
This method stands deprecated as of TestNG
7.3.0 |
ITestNGMethod[] |
getAllTestMethods() |
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Set<java.lang.String> |
getAttributeNames() |
ITestNGMethod[] |
getBeforeSuiteMethods() |
ITestNGMethod[] |
getBeforeTestConfigurationMethods() |
java.util.List<IConfigurationListener> |
getConfigurationListeners() |
IResultMap |
getConfigurationsScheduledForInvocation() |
XmlTest |
getCurrentXmlTest() |
java.util.Date |
getEndDate() |
java.lang.String[] |
getExcludedGroups() |
java.util.Collection<ITestNGMethod> |
getExcludedMethods() |
IResultMap |
getFailedButWithinSuccessPercentageTests() |
IResultMap |
getFailedConfigurations() |
IResultMap |
getFailedTests() |
java.util.Set<ITestResult> |
getFailedTests(ITestNGMethod tm) |
java.util.List<com.google.inject.Module> |
getGuiceModules(java.lang.Class<? extends com.google.inject.Module> cls)
This method stands deprecated as of TestNG
7.3.0 |
java.lang.String |
getHost() |
java.lang.String[] |
getIncludedGroups() |
com.google.inject.Injector |
getInjector(IClass iClass)
This method stands deprecated as of TestNG
7.3.0 |
com.google.inject.Injector |
getInjector(java.util.List<com.google.inject.Module> moduleInstances)
This method stands deprecated as of TestNG
7.3.0 |
IInjectorFactory |
getInjectorFactory() |
org.testng.internal.IInvoker |
getInvoker() |
java.lang.String |
getName() |
java.lang.String |
getOutputDirectory() |
IResultMap |
getPassedConfigurations() |
IResultMap |
getPassedTests() |
java.util.Set<ITestResult> |
getPassedTests(ITestNGMethod tm) |
IResultMap |
getSkippedConfigurations() |
IResultMap |
getSkippedTests() |
java.util.Set<ITestResult> |
getSkippedTests(ITestNGMethod tm) |
java.util.Date |
getStartDate() |
ISuite |
getSuite() |
XmlTest |
getTest() |
java.util.Collection<ITestClass> |
getTestClasses() |
java.util.List<ITestListener> |
getTestListeners() |
static int |
getVerbose() |
java.lang.Object |
removeAttribute(java.lang.String name)
Remove the attribute
|
void |
run()
The main entry method for TestRunner.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set a custom attribute.
|
void |
setOutputDirectory(java.lang.String od) |
void |
setTestName(java.lang.String name) |
void |
setVerbose(int n) |
protected TestRunner(org.testng.internal.IConfiguration configuration, ISuite suite, XmlTest test, java.lang.String outputDirectory, org.testng.internal.annotations.IAnnotationFinder finder, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners, java.util.Comparator<ITestNGMethod> comparator, DataProviderHolder otherHolder)
public TestRunner(org.testng.internal.IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners, java.util.Comparator<ITestNGMethod> comparator)
public TestRunner(org.testng.internal.IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners)
public org.testng.internal.IInvoker getInvoker()
public ITestNGMethod[] getBeforeSuiteMethods()
public ITestNGMethod[] getAfterSuiteMethods()
public ITestNGMethod[] getBeforeTestConfigurationMethods()
public ITestNGMethod[] getAfterTestConfigurationMethods()
public java.util.Collection<ITestClass> getTestClasses()
public void setTestName(java.lang.String name)
public void setOutputDirectory(java.lang.String od)
public void run()
This is where all the hard work is done: - Invoke configuration methods - Invoke test methods - Catch exceptions - Collect results - Invoke listeners - etc...
public java.util.List<IWorker<ITestNGMethod>> createWorkers(java.util.List<ITestNGMethod> methods)
createWorkers
in interface IThreadWorkerFactory<ITestNGMethod>
methods
- tasks that need to be executedpublic java.lang.String getName()
getName
in interface ITestContext
public java.util.Date getStartDate()
getStartDate
in interface ITestContext
public java.util.Date getEndDate()
getEndDate
in interface ITestContext
public IResultMap getPassedTests()
getPassedTests
in interface ITestContext
public IResultMap getSkippedTests()
getSkippedTests
in interface ITestContext
public IResultMap getFailedTests()
getFailedTests
in interface ITestContext
ITestNGMethod
public IResultMap getFailedButWithinSuccessPercentageTests()
getFailedButWithinSuccessPercentageTests
in interface ITestContext
public java.lang.String[] getIncludedGroups()
getIncludedGroups
in interface ITestContext
public java.lang.String[] getExcludedGroups()
getExcludedGroups
in interface ITestContext
public java.lang.String getOutputDirectory()
getOutputDirectory
in interface ITestContext
public ISuite getSuite()
getSuite
in interface ITestContext
public ITestNGMethod[] getAllTestMethods()
getAllTestMethods
in interface ITestContext
public java.lang.String getHost()
getHost
in interface ITestContext
public java.util.Collection<ITestNGMethod> getExcludedMethods()
getExcludedMethods
in interface ITestContext
public IResultMap getFailedConfigurations()
getFailedConfigurations
in interface ITestContext
ITestContext.getFailedConfigurations()
public IResultMap getConfigurationsScheduledForInvocation()
getConfigurationsScheduledForInvocation
in interface org.testng.internal.IConfigEavesdropper
public IResultMap getPassedConfigurations()
getPassedConfigurations
in interface ITestContext
ITestContext.getPassedConfigurations()
public IResultMap getSkippedConfigurations()
getSkippedConfigurations
in interface ITestContext
ITestContext.getSkippedConfigurations()
public void addPassedTest(ITestNGMethod tm, ITestResult tr)
addPassedTest
in interface org.testng.internal.ITestResultNotifier
public java.util.Set<ITestResult> getPassedTests(ITestNGMethod tm)
getPassedTests
in interface org.testng.internal.ITestResultNotifier
public java.util.Set<ITestResult> getFailedTests(ITestNGMethod tm)
getFailedTests
in interface org.testng.internal.ITestResultNotifier
public java.util.Set<ITestResult> getSkippedTests(ITestNGMethod tm)
getSkippedTests
in interface org.testng.internal.ITestResultNotifier
public void addSkippedTest(ITestNGMethod tm, ITestResult tr)
addSkippedTest
in interface org.testng.internal.ITestResultNotifier
public void addFailedTest(ITestNGMethod testMethod, ITestResult result)
addFailedTest
in interface org.testng.internal.ITestResultNotifier
public void addFailedButWithinSuccessPercentageTest(ITestNGMethod testMethod, ITestResult result)
addFailedButWithinSuccessPercentageTest
in interface org.testng.internal.ITestResultNotifier
public XmlTest getTest()
getTest
in interface org.testng.internal.ITestResultNotifier
public java.util.List<ITestListener> getTestListeners()
getTestListeners
in interface org.testng.internal.ITestResultNotifier
public java.util.List<IConfigurationListener> getConfigurationListeners()
getConfigurationListeners
in interface org.testng.internal.ITestResultNotifier
public static int getVerbose()
public void setVerbose(int n)
public void addListener(ITestNGListener listener)
public XmlTest getCurrentXmlTest()
getCurrentXmlTest
in interface ITestContext
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface IAttributes
name
- The name of the attribute to returnpublic void setAttribute(java.lang.String name, java.lang.Object value)
IAttributes
setAttribute
in interface IAttributes
name
- The attribute namevalue
- The attribute valuepublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames
in interface IAttributes
public java.lang.Object removeAttribute(java.lang.String name)
IAttributes
removeAttribute
in interface IAttributes
name
- The attribute namepublic java.util.List<com.google.inject.Module> getGuiceModules(java.lang.Class<? extends com.google.inject.Module> cls)
ITestContext
7.3.0
getGuiceModules
in interface ITestContext
public java.util.List<com.google.inject.Module> getAllGuiceModules()
ITestContext
7.3.0
getAllGuiceModules
in interface ITestContext
public void addGuiceModule(com.google.inject.Module module)
ITestContext
7.3.0
addGuiceModule
in interface ITestContext
public com.google.inject.Injector getInjector(java.util.List<com.google.inject.Module> moduleInstances)
ITestContext
7.3.0
getInjector
in interface ITestContext
public com.google.inject.Injector getInjector(IClass iClass)
ITestContext
7.3.0
getInjector
in interface ITestContext
public void addInjector(java.util.List<com.google.inject.Module> moduleInstances, com.google.inject.Injector injector)
ITestContext
7.3.0
addInjector
in interface ITestContext
public IInjectorFactory getInjectorFactory()
getInjectorFactory
in interface ITestContext