|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.testng.TestListenerAdapter
com.googlecode.lightest.core.LightestTestListener
public class LightestTestListener
This class is responsible for wiring task dispatchers to testcases, and recording the results of running tasks. It also notifies any registered reporters to generate reports at appropriate points in the test execution lifecycle. It supports two styles of reporters: ones that implement IReporter, and ones that implement ILightestReporter. The former is used to create a single report at the end of the suite run, while the latter may be updated throughout the run, as tests are completed.
| Field Summary | |
|---|---|
static String |
ATTR_STRATEGY
|
| Constructor Summary | |
|---|---|
LightestTestListener()
|
|
| Method Summary | |
|---|---|
void |
addEnvironmentMapping(Class testClass,
ITestEnvironment env)
Records the mapping between a test class and the environment in which the test was performed. |
void |
generateReport(List xmlSuites,
List suites,
String outputDirectory)
Invokes generateReport() on all registered IReporter reporters. |
groovy.lang.MetaClass |
getMetaClass()
|
String |
getOutputDir()
|
Object |
getProperty(String name)
|
TestRegistry |
getRegistry()
Returns the registry of pending tests. |
Map |
getTaskResultMap()
|
void |
initializeReporters(String configText)
Invokes generateBaseReport() on all registered reporters that are instances of ILightestReporter. |
Object |
invokeMethod(String name,
Object args)
|
void |
onFinish(ISuite suite)
Implemented to satisfy the ISuiteListener interface. |
void |
onFinish(ITestContext context)
Ensures the list of failed tests maintained by the TestNG TestRunner implementation underlying the ITestContext reflects the actual test result status. |
void |
onStart(ISuite suite)
Generates the base report for all registered ILightestReporter's . |
void |
onStart(ITestContext context)
|
void |
onTaskComplete(ITaskResult taskResult,
ITestResult testResult)
Adds the ITaskResult to the list kept for each ITestResult. |
void |
onTestFailure(ITestResult result)
|
void |
onTestFinish(ITestResult result)
Records test run information, updates testng-results.xml, and invokes the report for all registered ILightestReporter's . |
void |
onTestSkipped(ITestResult result)
|
void |
onTestStart(ITestResult result)
|
void |
onTestSuccess(ITestResult result)
Instead of simply delegating to the TestListenerAdapter, we first check if the tasks corresponding to the test method were all OK. |
void |
registerReporter(Object reporter)
Registers a new reporter to be notified of reportable events. |
protected void |
resolveResult(ITestResult result)
Resolves the result in the registry. |
void |
setDispatcherAssignmentStrategy(IDispatcherAssignmentStrategy strategy)
This listener is the mechanism through which the dispatcher assignment strategy is communicated to each testcase. |
void |
setMetaClass(groovy.lang.MetaClass metaClass)
|
void |
setOutputDir(String value)
Sets the output directory to be propagated to all registered reporters. |
void |
setProperty(String name,
Object value)
|
void |
setRegistry(TestRegistry value)
Sets the registry of pending tests, which are tests that will be run that have not yet been reported on. |
void |
setTaskResultMap(Map value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.testng.ITestListener |
|---|
onTestFailedButWithinSuccessPercentage |
| Field Detail |
|---|
public static final String ATTR_STRATEGY
| Constructor Detail |
|---|
public LightestTestListener()
| Method Detail |
|---|
public TestRegistry getRegistry()
ILightestTestListener
getRegistry in interface ILightestTestListenerpublic void setRegistry(TestRegistry value)
ILightestTestListener
setRegistry in interface ILightestTestListenerpublic String getOutputDir()
public void setOutputDir(String value)
ILightestTestListener
setOutputDir in interface ILightestTestListenerpublic Map getTaskResultMap()
public void setTaskResultMap(Map value)
public void addEnvironmentMapping(Class testClass,
ITestEnvironment env)
addEnvironmentMapping in interface ILightestTestListenertestClass - env - public void setDispatcherAssignmentStrategy(IDispatcherAssignmentStrategy strategy)
ILightestTestListener
setDispatcherAssignmentStrategy in interface ILightestTestListenerpublic void onFinish(ISuite suite)
onFinish in interface ISuiteListenersuite - public void onStart(ISuite suite)
onStart in interface ISuiteListenersuite - public void onFinish(ITestContext context)
onFinish in interface ITestListeneronFinish in class TestListenerAdaptercontext - public void onStart(ITestContext context)
onStart in interface ITestListeneronStart in class TestListenerAdapterpublic void onTestFailure(ITestResult result)
onTestFailure in interface ITestListeneronTestFailure in class TestListenerAdapterpublic void onTestSkipped(ITestResult result)
onTestSkipped in interface ITestListeneronTestSkipped in class TestListenerAdapterpublic void onTestStart(ITestResult result)
onTestStart in interface ITestListeneronTestStart in class TestListenerAdapterpublic void onTestSuccess(ITestResult result)
onTestSuccess in interface ITestListeneronTestSuccess in class TestListenerAdapterresult - public void onTestFinish(ITestResult result)
onTestFinish in interface ILightestTestListenerresult - protected void resolveResult(ITestResult result)
result -
public void onTaskComplete(ITaskResult taskResult,
ITestResult testResult)
onTaskComplete in interface ILightestTestListenertaskResult - testResult - the ITestResult associated with the currently
executing test
public void generateReport(List xmlSuites,
List suites,
String outputDirectory)
generateReport in interface IReporterxmlSuites - suites - outputDirectory - this is ignored; the current value of outputDir
on this object is used insteadpublic void registerReporter(Object reporter)
ILightestTestListener
registerReporter in interface ILightestTestListenerpublic void initializeReporters(String configText)
ILightestTestListener
initializeReporters in interface ILightestTestListenerconfigText - the textual configuration that was used to configure
this run, if any. May be null.public groovy.lang.MetaClass getMetaClass()
getMetaClass in interface groovy.lang.GroovyObjectpublic void setMetaClass(groovy.lang.MetaClass metaClass)
setMetaClass in interface groovy.lang.GroovyObject
public Object invokeMethod(String name,
Object args)
invokeMethod in interface groovy.lang.GroovyObjectpublic Object getProperty(String name)
getProperty in interface groovy.lang.GroovyObject
public void setProperty(String name,
Object value)
setProperty in interface groovy.lang.GroovyObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||