Class ForkClient
java.lang.Object
org.apache.maven.plugin.surefire.booterclient.output.ForkClient
- All Implemented Interfaces:
org.apache.maven.shared.utils.cli.StreamConsumer
Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
- Author:
- Kristian Rosenvold
-
Constructor Summary
ConstructorsConstructorDescriptionForkClient(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, AtomicBoolean printedErrorStream) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean hadTimeout) final voidfinal voidfinal DefaultReporterFactoryfinal org.apache.maven.surefire.report.StackTraceWriterfinal org.apache.maven.surefire.report.RunListenerUsed when getting reporters on the plugin side of a fork.final booleanbooleanfinal booleanfinal booleanvoidkill()voidsetForkNumber(int forkNumber) protected voidfinal voidtryToTimeout(long currentTimeMillis, int forkedProcessTimeoutInSeconds) Called in concurrent Thread.
-
Constructor Details
-
ForkClient
public ForkClient(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, AtomicBoolean printedErrorStream)
-
-
Method Details
-
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
-
consumeLine
- Specified by:
consumeLinein interfaceorg.apache.maven.shared.utils.cli.StreamConsumer
-
hadTimeout
public final boolean hadTimeout() -
consumeMultiLineContent
- Throws:
IOException
-
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
-
hasTestsInProgress
public boolean hasTestsInProgress() -
setForkNumber
public void setForkNumber(int forkNumber)
-