Class ErrorReportingTestListener

java.lang.Object
com.carrotsearch.gradle.buildinfra.testing.ErrorReportingTestListener
All Implemented Interfaces:
org.gradle.api.tasks.testing.TestListener, org.gradle.api.tasks.testing.TestOutputListener

public class ErrorReportingTestListener extends 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).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ErrorReportingTestListener(org.gradle.api.logging.Logger taskLogger, org.gradle.internal.logging.text.StyledTextOutput styledOut, ReproduceLineExtension reproduceLineExtension, org.gradle.api.tasks.testing.logging.TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode, boolean fullOutputOnErrorMode)
     
  • Method Summary

    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 testDescriptor)
     
    void
    beforeTest(org.gradle.api.tasks.testing.TestDescriptor testDescriptor)
     
    static 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 Object

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

    • ErrorReportingTestListener

      public ErrorReportingTestListener(org.gradle.api.logging.Logger taskLogger, org.gradle.internal.logging.text.StyledTextOutput styledOut, ReproduceLineExtension reproduceLineExtension, org.gradle.api.tasks.testing.logging.TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode, boolean fullOutputOnErrorMode)
  • Method Details

    • 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 testDescriptor)
      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 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