Class ExitCodeListener

java.lang.Object
org.testng.internal.ExitCodeListener
All Implemented Interfaces:
IExecutionListener, IReporter, ITestListener, ITestNGListener

public class ExitCodeListener extends Object implements ITestListener, IReporter, IExecutionListener
  • Field Details

    • hasTests

      private boolean hasTests
    • status

      private final ExitCode status
    • failIfAllTestsSkipped

      private boolean failIfAllTestsSkipped
  • Constructor Details

    • ExitCodeListener

      public ExitCodeListener()
  • Method Details

    • failIfAllTestsSkipped

      public void failIfAllTestsSkipped()
    • getStatus

      public ExitCode getStatus()
    • noTestsFound

      public boolean noTestsFound()
    • generateReport

      public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory)
      Description copied from interface: IReporter
      Generate a report for the given suites into the specified output directory.
      Specified by:
      generateReport in interface IReporter
      Parameters:
      xmlSuites - The list of XmlSuite
      suites - The list of ISuite
      outputDirectory - The output directory
    • 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:
    • onTestSuccess

      public void onTestSuccess(ITestResult result)
      Description copied from interface: ITestListener
      Invoked each time a test succeeds.
      Specified by:
      onTestSuccess in interface ITestListener
      Parameters:
      result - ITestResult containing information about the run test
      See Also:
    • onTestFailure

      public void onTestFailure(ITestResult result)
      Description copied from interface: ITestListener
      Invoked each time a test fails.
      Specified by:
      onTestFailure in interface ITestListener
      Parameters:
      result - ITestResult containing information about the run test
      See Also:
    • onTestSkipped

      public void onTestSkipped(ITestResult result)
      Description copied from interface: ITestListener
      Invoked each time a test is skipped.
      Specified by:
      onTestSkipped in interface ITestListener
      Parameters:
      result - ITestResult containing information about the run test
      See Also:
    • onTestFailedButWithinSuccessPercentage

      public void onTestFailedButWithinSuccessPercentage(ITestResult result)
      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:
      result - ITestResult containing information about the run test
      See Also:
    • onStart

      public void onStart(ITestContext context)
      Description copied from interface: ITestListener
      Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.
      Specified by:
      onStart in interface ITestListener
      Parameters:
      context - The test context
    • onFinish

      public void onFinish(ITestContext context)
      Description copied from interface: ITestListener
      Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.
      Specified by:
      onFinish in interface ITestListener
      Parameters:
      context - The test context
    • onExecutionFinish

      public void onExecutionFinish()
      Description copied from interface: IExecutionListener
      Invoked once all the suites have been run.
      Specified by:
      onExecutionFinish in interface IExecutionListener