Class ForkClient
- 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 java.lang.Object implements org.apache.maven.shared.utils.cli.StreamConsumerKnows how to reconstruct *all* the state transmitted over stdout by the forked process.- Author:
- Kristian Rosenvold
-
-
Constructor Summary
Constructors Constructor Description ForkClient(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, java.util.concurrent.atomic.AtomicBoolean printedErrorStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(boolean hadTimeout)voidconsumeLine(java.lang.String s)voidconsumeMultiLineContent(java.lang.String s)DefaultReporterFactorygetDefaultReporterFactory()org.apache.maven.surefire.report.StackTraceWritergetErrorInFork()org.apache.maven.surefire.report.RunListenergetReporter()Used when getting reporters on the plugin side of a fork.java.util.Map<java.lang.String,java.lang.String>getTestVmSystemProperties()booleanhadTimeout()booleanhasTestsInProgress()booleanisErrorInFork()booleanisSaidGoodBye()voidkill()voidsetForkNumber(int forkNumber)protected voidstopOnNextTest()java.util.Set<java.lang.String>testsInProgress()voidtryToTimeout(long currentTimeMillis, int forkedProcessTimeoutInSeconds)Called in concurrent Thread.
-
-
-
Constructor Detail
-
ForkClient
public ForkClient(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, java.util.concurrent.atomic.AtomicBoolean printedErrorStream)
-
-
Method Detail
-
stopOnNextTest
protected void stopOnNextTest()
-
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 secondsforkedProcessTimeoutInSeconds- timeout in seconds given by MOJO
-
getDefaultReporterFactory
public final DefaultReporterFactory getDefaultReporterFactory()
-
consumeLine
public final void consumeLine(java.lang.String s)
- Specified by:
consumeLinein interfaceorg.apache.maven.shared.utils.cli.StreamConsumer
-
hadTimeout
public final boolean hadTimeout()
-
consumeMultiLineContent
public final void consumeMultiLineContent(java.lang.String s) throws java.io.IOException- Throws:
java.io.IOException
-
getTestVmSystemProperties
public final java.util.Map<java.lang.String,java.lang.String> getTestVmSystemProperties()
-
getReporter
public final org.apache.maven.surefire.report.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
-
close
public void close(boolean hadTimeout)
-
isSaidGoodBye
public final boolean isSaidGoodBye()
-
getErrorInFork
public final org.apache.maven.surefire.report.StackTraceWriter getErrorInFork()
-
isErrorInFork
public final boolean isErrorInFork()
-
testsInProgress
public java.util.Set<java.lang.String> testsInProgress()
-
hasTestsInProgress
public boolean hasTestsInProgress()
-
setForkNumber
public void setForkNumber(int forkNumber)
-
-