Class ErrorReportingTestListener

java.lang.Object
com.carrotsearch.gradle.randomizedtesting.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).

  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  ErrorReportingTestListener.TestKey  
  • 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

    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 Details

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