Class StdOutputStream
java.lang.Object
java.io.OutputStream
org.junitpioneer.jupiter.StdOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]ThecapturedString(), divided on the line separator.final voidwrite(byte[] b, int off, int len) voidwrite(int i) Methods inherited from class OutputStream
close, flush, nullOutputStream, write
-
Field Details
-
out
-
-
Constructor Details
-
StdOutputStream
public StdOutputStream()
-
-
Method Details
-
write
public void write(int i) - Specified by:
writein classOutputStream
-
write
public final void write(byte[] b, int off, int len) - Overrides:
writein classOutputStream
-
capturedString
- Returns:
- the string that was written to
System.outorSystem.err
-
capturedLines
ThecapturedString(), divided on the line separator.This includes leading, inner, and trailing empty lines but does not include the potential empty string that comes after a trailing line separator. (The exact algorithm is based on but behaves differently from
String.split(String).)Because the return value does not include a trailing empty line that comes from a trailing line separator, it can't be used to distinguish the cases where the last line was created by a
printor aprintln. For more details and examples on this, see the documentation on standard input/output.- Returns:
- the lines that were written to
System.outorSystem.err
-