Class TestNGReporter

java.lang.Object
org.apache.maven.surefire.testng.TestNGReporter
All Implemented Interfaces:
org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>, org.apache.maven.surefire.report.RunModeSetter, org.testng.ISuiteListener, org.testng.ITestListener, org.testng.ITestNGListener
Direct Known Subclasses:
ConfigurationAwareTestNGReporter

public class TestNGReporter extends Object implements org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>, org.testng.ITestListener, org.testng.ISuiteListener, org.apache.maven.surefire.report.RunModeSetter
Listens for and provides and adaptor layer so that TestNG tests can report their status to the current RunListener.
Author:
jkuhnert
  • Constructor Summary

    Constructors
    Constructor
    Description
    TestNGReporter(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> reportManager)
    Constructs a new instance that will listen to test updates from a TestNG class instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final org.apache.maven.surefire.api.report.RunListener
     
    void
    onConfigurationFailure(org.testng.ITestResult result)
     
    void
    onConfigurationSkip(org.testng.ITestResult result)
     
    void
    onConfigurationSuccess(org.testng.ITestResult result)
     
    void
    onFinish(org.testng.ISuite suite)
     
    void
    onFinish(org.testng.ITestContext context)
     
    void
    onStart(org.testng.ISuite suite)
     
    void
    onStart(org.testng.ITestContext context)
     
    void
    onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
     
    void
    onTestFailure(org.testng.ITestResult result)
     
    void
    onTestSkipped(org.testng.ITestResult result)
     
    void
    onTestStart(org.testng.ITestResult result)
     
    void
    onTestSuccess(org.testng.ITestResult result)
     
    void
    setRunMode(org.apache.maven.surefire.api.report.RunMode runMode)
     
    void
    writeTestOutput(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry)
     

    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

    onTestFailedWithTimeout

    Methods inherited from interface org.testng.ITestNGListener

    isEnabled
  • Constructor Details

    • TestNGReporter

      public TestNGReporter(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> reportManager)
      Constructs a new instance that will listen to test updates from a TestNG class instance.
      Parameters:
      reportManager - Instance to report suite status to
  • Method Details

    • getRunListener

      protected final org.apache.maven.surefire.api.report.RunListener getRunListener()
    • onTestStart

      public void onTestStart(org.testng.ITestResult result)
      Specified by:
      onTestStart in interface org.testng.ITestListener
    • onTestSuccess

      public void onTestSuccess(org.testng.ITestResult result)
      Specified by:
      onTestSuccess in interface org.testng.ITestListener
    • onTestFailure

      public void onTestFailure(org.testng.ITestResult result)
      Specified by:
      onTestFailure in interface org.testng.ITestListener
    • onTestSkipped

      public void onTestSkipped(org.testng.ITestResult result)
      Specified by:
      onTestSkipped in interface org.testng.ITestListener
    • onTestFailedButWithinSuccessPercentage

      public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
      Specified by:
      onTestFailedButWithinSuccessPercentage in interface org.testng.ITestListener
    • onStart

      public void onStart(org.testng.ITestContext context)
      Specified by:
      onStart in interface org.testng.ITestListener
    • onFinish

      public void onFinish(org.testng.ITestContext context)
      Specified by:
      onFinish in interface org.testng.ITestListener
    • onStart

      public void onStart(org.testng.ISuite suite)
      Specified by:
      onStart in interface org.testng.ISuiteListener
    • onFinish

      public void onFinish(org.testng.ISuite suite)
      Specified by:
      onFinish in interface org.testng.ISuiteListener
    • onConfigurationFailure

      public void onConfigurationFailure(org.testng.ITestResult result)
    • onConfigurationSkip

      public void onConfigurationSkip(org.testng.ITestResult result)
    • onConfigurationSuccess

      public void onConfigurationSuccess(org.testng.ITestResult result)
    • setRunMode

      public void setRunMode(org.apache.maven.surefire.api.report.RunMode runMode)
      Specified by:
      setRunMode in interface org.apache.maven.surefire.report.RunModeSetter
    • writeTestOutput

      public void writeTestOutput(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry)
      Specified by:
      writeTestOutput in interface org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>