public class SystemOutputRule extends Object implements TestRule
System.out or System.err.
At the start of each test the System.out and System.err PrintStreams are replaced with ones that buffer data passed to them in memory, allowing the test to retrieve the contents of the buffer at any time and assert on it. At the end of the test the original PrintStreams are restored allowing access to the console again.
| Constructor and Description |
|---|
SystemOutputRule() |
| Modifier and Type | Method and Description |
|---|---|
Statement |
apply(Statement base,
Description description) |
String |
getSystemErr() |
String |
getSystemOut() |
public Statement apply(Statement base, Description description)
public String getSystemOut()
public String getSystemErr()
Copyright © 2013. All Rights Reserved.