@CompileStatic class SystemOutAndErrSwapper extends Object
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 PrintStream |
swappedInErr |
|
protected OutputStream |
swappedInErrStream |
|
protected PrintStream |
swappedInOut |
|
protected OutputStream |
swappedInOutStream |
|
protected PrintStream |
swappedOutErr |
|
protected PrintStream |
swappedOutOut |
Constructor and description |
---|
SystemOutAndErrSwapper(boolean echoOut, boolean echoErr) |
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
isSwapped() |
|
List<OutputStream> |
swapIn() Replaces System.out and System.err with PrintStream's wrapping outStream and errStream |
|
List<OutputStream> |
swapIn(OutputStream outStream, OutputStream errStream) Replaces System.out and System.err with PrintStream's wrapping outStream and errStream |
|
List<OutputStream> |
swapOut() Restores System.out and System.err to what they were before swappedIn() was called. |
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.