Class ErrorReportingTestListener

  • All Implemented Interfaces:
    org.gradle.api.tasks.testing.TestListener, org.gradle.api.tasks.testing.TestOutputListener

    public class ErrorReportingTestListener
    extends java.lang.Object
    implements org.gradle.api.tasks.testing.TestOutputListener, org.gradle.api.tasks.testing.TestListener
    An error reporting listener that queues test output streams and displays them on failure.

    Heavily inspired by Elasticsearch's ErrorReportingTestListener (ASL 2.0 licensed).

    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorReportingTestListener​(org.gradle.api.tasks.testing.logging.TestLogging testLogging, java.nio.file.Path spillDir, java.nio.file.Path outputsDir, org.gradle.api.provider.Provider<java.lang.Boolean> verboseMode)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterSuite​(org.gradle.api.tasks.testing.TestDescriptor suite, org.gradle.api.tasks.testing.TestResult result)  
      void afterTest​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor, org.gradle.api.tasks.testing.TestResult result)  
      void beforeSuite​(org.gradle.api.tasks.testing.TestDescriptor suite)  
      void beforeTest​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor)  
      static java.lang.String getOutputLogName​(org.gradle.api.tasks.testing.TestDescriptor suite)  
      void onOutput​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor, org.gradle.api.tasks.testing.TestOutputEvent outputEvent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorReportingTestListener

        public ErrorReportingTestListener​(org.gradle.api.tasks.testing.logging.TestLogging testLogging,
                                          java.nio.file.Path spillDir,
                                          java.nio.file.Path outputsDir,
                                          org.gradle.api.provider.Provider<java.lang.Boolean> verboseMode)
    • Method Detail

      • onOutput

        public void onOutput​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor,
                             org.gradle.api.tasks.testing.TestOutputEvent outputEvent)
        Specified by:
        onOutput in interface org.gradle.api.tasks.testing.TestOutputListener
      • beforeSuite

        public void beforeSuite​(org.gradle.api.tasks.testing.TestDescriptor suite)
        Specified by:
        beforeSuite in interface org.gradle.api.tasks.testing.TestListener
      • beforeTest

        public void beforeTest​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor)
        Specified by:
        beforeTest in interface org.gradle.api.tasks.testing.TestListener
      • afterSuite

        public void afterSuite​(org.gradle.api.tasks.testing.TestDescriptor suite,
                               org.gradle.api.tasks.testing.TestResult result)
        Specified by:
        afterSuite in interface org.gradle.api.tasks.testing.TestListener
      • getOutputLogName

        public static java.lang.String getOutputLogName​(org.gradle.api.tasks.testing.TestDescriptor suite)
      • afterTest

        public void afterTest​(org.gradle.api.tasks.testing.TestDescriptor testDescriptor,
                              org.gradle.api.tasks.testing.TestResult result)
        Specified by:
        afterTest in interface org.gradle.api.tasks.testing.TestListener