Class ForkClient
java.lang.Object
org.apache.maven.plugin.surefire.booterclient.output.ForkClient
- All Implemented Interfaces:
EventHandler<Event>
Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class
private final class
private final class
private final class
private class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
private final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DefaultReporterFactory
private StackTraceWriter
private final int
private final NotifiableTestStream
private final ForkedProcessEventNotifier
private boolean
Written by one Thread and read by another: Main Thread and ForkStarter's Thread.private static final long
private static final long
private TestReportListener<TestOutputReportEntry>
private final AtomicLong
testSetStartedAt is set to non-zero after receivedMasterProcessChannelEncoder.testSetStarting(TestSetReportEntry, boolean)
. -
Constructor Summary
ConstructorsConstructorDescriptionForkClient
(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, int forkNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(boolean hadTimeout) (package private) void
dumpToLoFile
(String msg) private ConsoleLogger
Used when getting reporters on the plugin side of a fork.private TestReportListener<TestOutputReportEntry>
OnlygetConsoleOutputReceiver()
may call this method in another Thread.boolean
void
handleEvent
(Event event) boolean
boolean
boolean
void
kill()
private void
void
void
tryToTimeout
(long currentTimeMillis, int forkedProcessTimeoutInSeconds) Called in concurrent Thread.private void
writeTestOutput
(String output, boolean isStdout, boolean newLine, RunMode runMode, Long testRunId)
-
Field Details
-
START_TIME_ZERO
private static final long START_TIME_ZERO- See Also:
-
START_TIME_NEGATIVE_TIMEOUT
private static final long START_TIME_NEGATIVE_TIMEOUT- See Also:
-
defaultReporterFactory
-
testVmSystemProperties
-
notifiableTestStream
-
testsInProgress
-
testSetStartedAt
testSetStartedAt is set to non-zero after receivedMasterProcessChannelEncoder.testSetStarting(TestSetReportEntry, boolean)
. -
notifier
-
forkNumber
private final int forkNumber -
testSetReporter
-
saidGoodBye
private volatile boolean saidGoodByeWritten by one Thread and read by another: Main Thread and ForkStarter's Thread. -
errorInFork
-
-
Constructor Details
-
ForkClient
public ForkClient(DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, int forkNumber)
-
-
Method Details
-
setStopOnNextTestListener
-
kill
public void kill() -
tryToTimeout
public 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
-
handleEvent
- Specified by:
handleEvent
in interfaceEventHandler<Event>
-
setCurrentStartTime
private void setCurrentStartTime() -
hadTimeout
public boolean hadTimeout() -
getTestSetReporter
OnlygetConsoleOutputReceiver()
may call this method in another Thread. -
dumpToLoFile
-
writeTestOutput
-
getTestVmSystemProperties
-
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
-
getConsoleOutputReceiver
-
getOrCreateConsoleLogger
-
close
public void close(boolean hadTimeout) -
isSaidGoodBye
public boolean isSaidGoodBye() -
getErrorInFork
-
isErrorInFork
public boolean isErrorInFork() -
testsInProgress
-
hasTestsInProgress
public boolean hasTestsInProgress()
-