org.testng.reporters
Class JUnitXMLReporter2

java.lang.Object
  extended by org.testng.reporters.JUnitXMLReporter2
All Implemented Interfaces:
org.testng.internal.IConfigurationListener, org.testng.internal.IResultListener, ITestListener, ITestNGListener

public class JUnitXMLReporter2
extends java.lang.Object
implements org.testng.internal.IResultListener

this XML Reporter will produce XML format compatible with the XMLJUnitResultFormatter from ant this enables TestNG output to be processed by tools that already handle this format borrows heavily from ideas in org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter this is the original version which was replaced by JUnitXMLReporter


Constructor Summary
JUnitXMLReporter2()
           
 
Method Summary
protected  void generateReport()
          generate the XML report given what we know from all the test results
 void onConfigurationFailure(ITestResult itr)
           
 void onConfigurationSkip(ITestResult itr)
           
 void onConfigurationSuccess(ITestResult itr)
           
 void onFinish(ITestContext context)
          Invoked after all the tests have run and all their Configuration methods have been called.
 void onStart(ITestContext context)
          Invoked after the test class is instantiated and before any configuration method is called.
 void onTestFailedButWithinSuccessPercentage(ITestResult tr)
          Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.
 void onTestFailure(ITestResult tr)
          Invoked each time a test fails.
 void onTestSkipped(ITestResult tr)
          Invoked each time a test is skipped.
 void onTestStart(ITestResult result)
          Invoked each time before a test will be invoked.
 void onTestSuccess(ITestResult tr)
          Invoked each time a test succeeds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUnitXMLReporter2

public JUnitXMLReporter2()
Method Detail

onTestStart

public void onTestStart(ITestResult result)
Description copied from interface: ITestListener
Invoked each time before a test will be invoked. The ITestResult is only partially filled with the references to class, method, start millis and status.

Specified by:
onTestStart in interface ITestListener
Parameters:
result - the partially filled ITestResult
See Also:
ITestResult.STARTED

onTestSuccess

public void onTestSuccess(ITestResult tr)
Invoked each time a test succeeds.

Specified by:
onTestSuccess in interface ITestListener
Parameters:
tr - ITestResult containing information about the run test
See Also:
ITestResult.SUCCESS

onTestFailedButWithinSuccessPercentage

public void onTestFailedButWithinSuccessPercentage(ITestResult tr)
Description copied from interface: ITestListener
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.

Specified by:
onTestFailedButWithinSuccessPercentage in interface ITestListener
Parameters:
tr - ITestResult containing information about the run test
See Also:
ITestResult.SUCCESS_PERCENTAGE_FAILURE

onTestFailure

public void onTestFailure(ITestResult tr)
Invoked each time a test fails.

Specified by:
onTestFailure in interface ITestListener
Parameters:
tr - ITestResult containing information about the run test
See Also:
ITestResult.FAILURE

onTestSkipped

public void onTestSkipped(ITestResult tr)
Invoked each time a test is skipped.

Specified by:
onTestSkipped in interface ITestListener
Parameters:
tr - ITestResult containing information about the run test
See Also:
ITestResult.SKIP

onStart

public void onStart(ITestContext context)
Invoked after the test class is instantiated and before any configuration method is called.

Specified by:
onStart in interface ITestListener

onFinish

public void onFinish(ITestContext context)
Invoked after all the tests have run and all their Configuration methods have been called.

Specified by:
onFinish in interface ITestListener

generateReport

protected void generateReport()
generate the XML report given what we know from all the test results


onConfigurationFailure

public void onConfigurationFailure(ITestResult itr)
Specified by:
onConfigurationFailure in interface org.testng.internal.IConfigurationListener
See Also:
IConfigurationListener.onConfigurationFailure(org.testng.ITestResult)

onConfigurationSkip

public void onConfigurationSkip(ITestResult itr)
Specified by:
onConfigurationSkip in interface org.testng.internal.IConfigurationListener
See Also:
IConfigurationListener.onConfigurationSkip(org.testng.ITestResult)

onConfigurationSuccess

public void onConfigurationSuccess(ITestResult itr)
Specified by:
onConfigurationSuccess in interface org.testng.internal.IConfigurationListener
See Also:
IConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)


Copyright © 2011. All Rights Reserved.