Class ThreadedStreamConsumer.Pumper
- java.lang.Object
-
- org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.Pumper
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- ThreadedStreamConsumer
final class ThreadedStreamConsumer.Pumper extends java.lang.Object implements java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description private MultipleFailureException
errors
private org.apache.maven.shared.utils.cli.StreamConsumer
target
-
Constructor Summary
Constructors Constructor Description Pumper(org.apache.maven.shared.utils.cli.StreamConsumer target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
hasErrors()
void
run()
CallsForkClient.consumeLine(String)
which may throw anyRuntimeException
.
Even ifForkClient
is not fault-tolerant, this method MUST be fault-tolerant and thus the try-catch block must be inside of the loop which prevents from loosing events fromStreamConsumer
.(package private) void
throwErrors()
-
-
-
Field Detail
-
target
private final org.apache.maven.shared.utils.cli.StreamConsumer target
-
errors
private final MultipleFailureException errors
-
-
Method Detail
-
run
public void run()
CallsForkClient.consumeLine(String)
which may throw anyRuntimeException
.
Even ifForkClient
is not fault-tolerant, this method MUST be fault-tolerant and thus the try-catch block must be inside of the loop which prevents from loosing events fromStreamConsumer
.
IfConsoleOutputFileReporter.writeTestOutput(java.lang.String, boolean, boolean)
throwsIOException
and thentarget.consumeLine()
throws any RuntimeException, this method MUST NOT skip reading the events from the forked JVM; otherwise we could simply lost events e.g. acquire-next-test which means thatForkClient
could hang on waiting for old test to complete and therefore the plugin could be permanently in progress.- Specified by:
run
in interfacejava.lang.Runnable
-
hasErrors
boolean hasErrors()
-
throwErrors
void throwErrors() throws java.io.IOException
- Throws:
java.io.IOException
-
-