java.lang.Object
org.apache.maven.plugin.surefire.booterclient.output.ForkClient
All Implemented Interfaces:
org.apache.maven.shared.utils.cli.StreamConsumer

public class ForkClient extends Object implements org.apache.maven.shared.utils.cli.StreamConsumer
Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
  • Field Details

  • Constructor Details

  • Method Details

    • stopOnNextTest

      protected void stopOnNextTest()
      Overridden by a subclass, see ForkStarter.
    • kill

      public void kill()
    • tryToTimeout

      public final void tryToTimeout(long currentTimeMillis, int forkedProcessTimeoutInSeconds)
      Called in concurrent Thread. Will shutdown if timeout was reached.
      Parameters:
      currentTimeMillis - current time in millis seconds
      forkedProcessTimeoutInSeconds - timeout in seconds given by MOJO
    • getDefaultReporterFactory

      public final DefaultReporterFactory getDefaultReporterFactory()
    • consumeLine

      public final void consumeLine(String s)
      Specified by:
      consumeLine in interface org.apache.maven.shared.utils.cli.StreamConsumer
    • setCurrentStartTime

      private void setCurrentStartTime()
    • hadTimeout

      public final boolean hadTimeout()
    • getTestSetReporter

      private RunListener getTestSetReporter()
    • processLine

      private void processLine(String event)
    • dumpToLoFile

      private File dumpToLoFile(String msg, Throwable e)
    • logStreamWarning

      private void logStreamWarning(String event, Throwable e)
    • writeTestOutput

      private void writeTestOutput(String output, boolean newLine, boolean isStdout)
    • consumeMultiLineContent

      public final void consumeMultiLineContent(String s) throws IOException
      Throws:
      IOException
    • getTestVmSystemProperties

      public final Map<String,String> getTestVmSystemProperties()
    • getReporter

      public final RunListener getReporter()
      Used when getting reporters on the plugin side of a fork. Used by testing purposes only. May not be volatile variable.
      Returns:
      A mock provider reporter
    • getOrCreateConsoleOutputReceiver

      private ConsoleOutputReceiver getOrCreateConsoleOutputReceiver()
    • getOrCreateConsoleLogger

      private ConsoleLogger getOrCreateConsoleLogger()
    • close

      public void close(boolean hadTimeout)
    • isSaidGoodBye

      public final boolean isSaidGoodBye()
    • getErrorInFork

      public final StackTraceWriter getErrorInFork()
    • isErrorInFork

      public final boolean isErrorInFork()
    • testsInProgress

      public Set<String> testsInProgress()
    • hasTestsInProgress

      public boolean hasTestsInProgress()
    • deserializeStackTraceWriter

      private StackTraceWriter deserializeStackTraceWriter(String stackTraceMessage, String smartStackTrace, String stackTrace)