Package org.testng.reporters
Class JUnitXMLReporter
- java.lang.Object
-
- org.testng.reporters.JUnitXMLReporter
-
- All Implemented Interfaces:
IConfigurationListener,IResultListener,IResultListener2,ITestListener,ITestNGListener
public class JUnitXMLReporter extends java.lang.Object implements IResultListener2
A JUnit XML report generator (replacing the original JUnitXMLReporter that was based on XML APIs).- Author:
- Alex Popescu
-
-
Constructor Summary
Constructors Constructor Description JUnitXMLReporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidgenerateReport(ITestContext context)generate the XML report given what we know from all the test resultsvoidonConfigurationFailure(ITestResult itr)Invoked whenever a configuration method failed.voidonConfigurationSkip(ITestResult itr)Invoked whenever a configuration method was skipped.voidonConfigurationSuccess(ITestResult itr)Invoked whenever a configuration method succeeded.voidonFinish(ITestContext context)Invoked after all the tests have run and all their Configuration methods have been called.voidonStart(ITestContext context)Invoked after the test class is instantiated and before any configuration method is called.voidonTestFailedButWithinSuccessPercentage(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.voidonTestFailure(ITestResult tr)Invoked each time a test fails.voidonTestSkipped(ITestResult tr)Invoked each time a test is skipped.voidonTestSuccess(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
-
Methods inherited from interface org.testng.IConfigurationListener
beforeConfiguration, beforeConfiguration, onConfigurationFailure, onConfigurationSkip, onConfigurationSuccess
-
Methods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout, onTestStart
-
Methods inherited from interface org.testng.ITestNGListener
isEnabled
-
-
-
-
Method Detail
-
onTestSuccess
public void onTestSuccess(ITestResult tr)
Invoked each time a test succeeds.- Specified by:
onTestSuccessin interfaceITestListener- Parameters:
tr-ITestResultcontaining information about the run test- See Also:
ITestResult.SUCCESS
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(ITestResult tr)
Description copied from interface:ITestListenerInvoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.- Specified by:
onTestFailedButWithinSuccessPercentagein interfaceITestListener- Parameters:
tr-ITestResultcontaining 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:
onTestFailurein interfaceITestListener- Parameters:
tr-ITestResultcontaining information about the run test- See Also:
ITestResult.FAILURE
-
onTestSkipped
public void onTestSkipped(ITestResult tr)
Invoked each time a test is skipped.- Specified by:
onTestSkippedin interfaceITestListener- Parameters:
tr-ITestResultcontaining 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:
onStartin interfaceITestListener- Parameters:
context- The test context
-
onFinish
public void onFinish(ITestContext context)
Invoked after all the tests have run and all their Configuration methods have been called.- Specified by:
onFinishin interfaceITestListener- Parameters:
context- The test context
-
onConfigurationFailure
public void onConfigurationFailure(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method failed.- Specified by:
onConfigurationFailurein interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationFailure(org.testng.ITestResult)
-
onConfigurationSkip
public void onConfigurationSkip(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method was skipped.- Specified by:
onConfigurationSkipin interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationSkip(org.testng.ITestResult)
-
onConfigurationSuccess
public void onConfigurationSuccess(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method succeeded.- Specified by:
onConfigurationSuccessin interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)
-
generateReport
protected void generateReport(ITestContext context)
generate the XML report given what we know from all the test results- Parameters:
context- The test context
-
-