public class TestRunner extends java.lang.Object implements ITestContext, ITestResultNotifier, IThreadWorkerFactory<ITestNGMethod>
| Modifier | Constructor and Description |
|---|---|
|
TestRunner(IConfiguration configuration,
ISuite suite,
XmlTest test,
boolean skipFailedInvocationCounts,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
java.util.List<IClassListener> classListeners) |
protected |
TestRunner(IConfiguration configuration,
ISuite suite,
XmlTest test,
java.lang.String outputDirectory,
IAnnotationFinder finder,
boolean skipFailedInvocationCounts,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
java.util.List<IClassListener> classListeners) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFailedButWithinSuccessPercentageTest(ITestNGMethod testMethod,
ITestResult result) |
void |
addFailedTest(ITestNGMethod testMethod,
ITestResult result) |
void |
addInjector(java.util.List<com.google.inject.Module> moduleInstances,
com.google.inject.Injector injector) |
void |
addInvokedMethod(InvokedMethod im) |
void |
addListener(ITestNGListener listener) |
void |
addListener(java.lang.Object listener)
Deprecated.
addListener(ITestNGListener) should be used instead
|
void |
addMethodInterceptor(IMethodInterceptor methodInterceptor) |
void |
addPassedTest(ITestNGMethod tm,
ITestResult tr) |
void |
addSkippedTest(ITestNGMethod tm,
ITestResult tr) |
void |
addTestListener(ITestListener il)
Deprecated.
addListener(ITestNGListener) should be used instead
|
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() |
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() |
XmlTest |
getCurrentXmlTest() |
java.util.Date |
getEndDate()
When this test stopped running.
|
java.lang.String[] |
getExcludedGroups() |
java.util.Collection<ITestNGMethod> |
getExcludedMethods() |
IResultMap |
getFailedButWithinSuccessPercentageTests() |
IResultMap |
getFailedConfigurations()
Retrieves information about the failed configuration method invocations.
|
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) |
java.lang.String |
getHost() |
java.lang.String[] |
getIncludedGroups() |
com.google.inject.Injector |
getInjector(IClass iClass) |
com.google.inject.Injector |
getInjector(java.util.List<com.google.inject.Module> moduleInstances) |
java.util.List<ITestNGMethod> |
getInvokedMethods() |
IInvoker |
getInvoker() |
java.lang.String |
getName()
The name of this test.
|
java.lang.String |
getOutputDirectory() |
IResultMap |
getPassedConfigurations()
Retrieves information about the successful configuration method invocations.
|
IResultMap |
getPassedTests() |
java.util.Set<ITestResult> |
getPassedTests(ITestNGMethod tm) |
IResultMap |
getSkippedConfigurations()
Retrieves information about the skipped configuration method invocations.
|
IResultMap |
getSkippedTests() |
java.util.Set<ITestResult> |
getSkippedTests(ITestNGMethod tm) |
java.util.Date |
getStartDate()
When this test started running.
|
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 |
setMethodInterceptor(IMethodInterceptor methodInterceptor)
Deprecated.
|
void |
setOutputDirectory(java.lang.String od) |
void |
setTestName(java.lang.String name) |
void |
setVerbose(int n) |
protected TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, java.lang.String outputDirectory, IAnnotationFinder finder, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners)
public TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners)
public 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()
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()
ITestContextgetName in interface ITestContextpublic java.util.Date getStartDate()
ITestContextgetStartDate in interface ITestContextpublic java.util.Date getEndDate()
ITestContextgetEndDate in interface ITestContextpublic IResultMap getPassedTests()
getPassedTests in interface ITestContextpublic IResultMap getSkippedTests()
getSkippedTests in interface ITestContextpublic IResultMap getFailedTests()
getFailedTests in interface ITestContextITestNGMethodpublic IResultMap getFailedButWithinSuccessPercentageTests()
getFailedButWithinSuccessPercentageTests in interface ITestContextpublic java.lang.String[] getIncludedGroups()
getIncludedGroups in interface ITestContextpublic java.lang.String[] getExcludedGroups()
getExcludedGroups in interface ITestContextpublic java.lang.String getOutputDirectory()
getOutputDirectory in interface ITestContextpublic ISuite getSuite()
getSuite in interface ITestContextpublic ITestNGMethod[] getAllTestMethods()
getAllTestMethods in interface ITestContextpublic java.lang.String getHost()
getHost in interface ITestContextpublic java.util.Collection<ITestNGMethod> getExcludedMethods()
getExcludedMethods in interface ITestContextpublic IResultMap getFailedConfigurations()
ITestContextgetFailedConfigurations in interface ITestContextITestContext.getFailedConfigurations()public IResultMap getPassedConfigurations()
ITestContextgetPassedConfigurations in interface ITestContextITestContext.getPassedConfigurations()public IResultMap getSkippedConfigurations()
ITestContextgetSkippedConfigurations in interface ITestContextITestContext.getSkippedConfigurations()public void addPassedTest(ITestNGMethod tm, ITestResult tr)
addPassedTest in interface ITestResultNotifierpublic java.util.Set<ITestResult> getPassedTests(ITestNGMethod tm)
getPassedTests in interface ITestResultNotifierpublic java.util.Set<ITestResult> getFailedTests(ITestNGMethod tm)
getFailedTests in interface ITestResultNotifierpublic java.util.Set<ITestResult> getSkippedTests(ITestNGMethod tm)
getSkippedTests in interface ITestResultNotifierpublic void addSkippedTest(ITestNGMethod tm, ITestResult tr)
addSkippedTest in interface ITestResultNotifierpublic void addInvokedMethod(InvokedMethod im)
addInvokedMethod in interface ITestResultNotifierpublic void addFailedTest(ITestNGMethod testMethod, ITestResult result)
addFailedTest in interface ITestResultNotifierpublic void addFailedButWithinSuccessPercentageTest(ITestNGMethod testMethod, ITestResult result)
addFailedButWithinSuccessPercentageTest in interface ITestResultNotifierpublic XmlTest getTest()
getTest in interface ITestResultNotifierpublic java.util.List<ITestListener> getTestListeners()
getTestListeners in interface ITestResultNotifierpublic java.util.List<IConfigurationListener> getConfigurationListeners()
getConfigurationListeners in interface ITestResultNotifierpublic static int getVerbose()
public void setVerbose(int n)
@Deprecated public void addListener(java.lang.Object listener)
public void addListener(ITestNGListener listener)
@Deprecated public void addTestListener(ITestListener il)
public java.util.List<ITestNGMethod> getInvokedMethods()
@Deprecated public void setMethodInterceptor(IMethodInterceptor methodInterceptor)
public void addMethodInterceptor(IMethodInterceptor methodInterceptor)
public XmlTest getCurrentXmlTest()
getCurrentXmlTest in interface ITestContextpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface IAttributesname - The name of the attribute to returnpublic void setAttribute(java.lang.String name,
java.lang.Object value)
IAttributessetAttribute in interface IAttributespublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames in interface IAttributespublic java.lang.Object removeAttribute(java.lang.String name)
IAttributesremoveAttribute in interface IAttributespublic java.util.List<com.google.inject.Module> getGuiceModules(java.lang.Class<? extends com.google.inject.Module> cls)
getGuiceModules in interface ITestContextpublic com.google.inject.Injector getInjector(java.util.List<com.google.inject.Module> moduleInstances)
getInjector in interface ITestContextpublic com.google.inject.Injector getInjector(IClass iClass)
getInjector in interface ITestContextpublic void addInjector(java.util.List<com.google.inject.Module> moduleInstances,
com.google.inject.Injector injector)
addInjector in interface ITestContext