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 PrintStreamprivate final ThreadLocal<StreamInterceptor.RewindableByteArrayOutputStream> private final Consumer<PrintStream> Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStreamInterceptor(PrintStream originalStream, Consumer<PrintStream> unregisterAction, int maxNumberOfBytesPerThread) -
Method Summary
Modifier and TypeMethodDescription(package private) voidcapture()(package private) Stringconsume()(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 java.io.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 java.io.OutputStream
nullOutputStream
-
Field Details
-
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
-