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 MultipleFailureExceptionerrorsprivate org.apache.maven.shared.utils.cli.StreamConsumertarget
-
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) booleanhasErrors()voidrun()CallsForkClient.consumeLine(String)which may throw anyRuntimeException.
Even ifForkClientis 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) voidthrowErrors()
-
-
-
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 ifForkClientis 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(byte[], int, int, boolean)throwsIOExceptionand 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 thatForkClientcould hang on waiting for old test to complete and therefore the plugin could be permanently in progress.- Specified by:
runin interfacejava.lang.Runnable
-
hasErrors
boolean hasErrors()
-
throwErrors
void throwErrors() throws java.io.IOException- Throws:
java.io.IOException
-
-