Convenience class to temporarily swap in an output stream for standard error and standard out.
Modifiers | Name | Description |
---|---|---|
static class |
SystemOutAndErrSwapper.TestOutputCapturingPrintStream |
Modifiers | Name | Description |
---|---|---|
protected boolean |
swapped |
|
protected java.io.PrintStream |
swappedInErr |
|
protected java.io.OutputStream |
swappedInErrStream |
|
protected java.io.PrintStream |
swappedInOut |
|
protected java.io.OutputStream |
swappedInOutStream |
|
protected java.io.PrintStream |
swappedOutErr |
|
protected java.io.PrintStream |
swappedOutOut |
Constructor and description |
---|
SystemOutAndErrSwapper
(boolean echoOut = false, boolean echoErr = false) |
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
isSwapped() |
|
java.util.List<java.io.OutputStream> |
swapIn() Replaces System.out and System.err with PrintStream's wrapping outStream and errStream |
|
java.util.List<java.io.OutputStream> |
swapIn(java.io.OutputStream outStream, java.io.OutputStream errStream) Replaces System.out and System.err with PrintStream's wrapping outStream and errStream |
|
java.util.List<java.io.OutputStream> |
swapOut() Restores System.out and System.err to what they were before swappedIn() was called. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Replaces System.out and System.err with PrintStream's wrapping outStream and errStream
Replaces System.out and System.err with PrintStream's wrapping outStream and errStream
Restores System.out and System.err to what they were before swappedIn() was called.