Class FailFastNotifier

  • All Implemented Interfaces:
    org.testng.IInvokedMethodListener, org.testng.ITestListener, org.testng.ITestNGListener

    public class FailFastNotifier
    extends java.lang.Object
    implements org.testng.IInvokedMethodListener, org.testng.ITestListener
    Notifies TestNG core skipping remaining tests after first failure has appeared. Enabled when -DtestFailFast=true This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-1762 since the bug makes the built-in fast-fast feature `-Dsurefire.skipAfterFailureCount=1` unusable. Maven Surefire version 3.0.0-M5 contains the fix, but that version is unusable because of problems with test output, https://issues.apache.org/jira/browse/SUREFIRE-1827. It makes the Pulsar integration tests slow and to fail. This implementation is based on org.apache.maven.surefire.testng.utils.FailFastNotifier implementation that is part of the Maven Surefire plugin.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterInvocation​(org.testng.IInvokedMethod iInvokedMethod, org.testng.ITestResult iTestResult)  
      void beforeInvocation​(org.testng.IInvokedMethod iInvokedMethod, org.testng.ITestResult iTestResult)  
      void onTestFailure​(org.testng.ITestResult result)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.testng.IInvokedMethodListener

        afterInvocation, beforeInvocation
      • Methods inherited from interface org.testng.ITestListener

        onFinish, onStart, onTestFailedButWithinSuccessPercentage, onTestFailedWithTimeout, onTestSkipped, onTestStart, onTestSuccess
    • Constructor Detail

      • FailFastNotifier

        public FailFastNotifier()
    • Method Detail

      • onTestFailure

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

        public void beforeInvocation​(org.testng.IInvokedMethod iInvokedMethod,
                                     org.testng.ITestResult iTestResult)
        Specified by:
        beforeInvocation in interface org.testng.IInvokedMethodListener
      • afterInvocation

        public void afterInvocation​(org.testng.IInvokedMethod iInvokedMethod,
                                    org.testng.ITestResult iTestResult)
        Specified by:
        afterInvocation in interface org.testng.IInvokedMethodListener