Class StreamInterceptor
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.junit.platform.launcher.core.StreamInterceptor
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
- Since:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final Deque<StreamInterceptor.RewindableByteArrayOutputStream> private final PrintStreamprivate final ThreadLocal<StreamInterceptor.RewindableByteArrayOutputStream> private final Consumer<PrintStream> Fields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStreamInterceptor(PrintStream originalStream, Consumer<PrintStream> unregisterAction, int maxNumberOfBytesPerThread) -
Method Summary
Modifier and TypeMethodDescription(package private) voidcapture()(package private) Stringconsume()private void(package private) static Optional<StreamInterceptor> register(PrintStream originalStream, Consumer<PrintStream> streamSetter, int maxNumberOfBytesPerThread) (package private) static Optional<StreamInterceptor> registerStderr(int maxNumberOfBytesPerThread) (package private) static Optional<StreamInterceptor> registerStdout(int maxNumberOfBytesPerThread) (package private) voidvoidwrite(byte[] b) voidwrite(byte[] buf, int off, int len) voidwrite(int b) Methods inherited from class PrintStream
append, append, append, charset, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, writeBytesMethods inherited from class OutputStream
nullOutputStream
-
Field Details
-
mostRecentOutputs
-
originalStream
-
unregisterAction
-
maxNumberOfBytesPerThread
private final int maxNumberOfBytesPerThread -
output
-
-
Constructor Details
-
StreamInterceptor
private StreamInterceptor(PrintStream originalStream, Consumer<PrintStream> unregisterAction, int maxNumberOfBytesPerThread)
-
-
Method Details
-
registerStdout
-
registerStderr
-
register
static Optional<StreamInterceptor> register(PrintStream originalStream, Consumer<PrintStream> streamSetter, int maxNumberOfBytesPerThread) -
capture
void capture() -
consume
String consume() -
unregister
void unregister() -
write
public void write(int b) - Overrides:
writein classPrintStream
-
write
public void write(byte[] b) - Overrides:
writein classPrintStream
-
write
public void write(byte[] buf, int off, int len) - Overrides:
writein classPrintStream
-
pushToTop
-
getOutput
-