|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javalite.test.SystemStreamUtil
public class SystemStreamUtil
This class can be used to catch standard and error outputs in tests so as not to pollute test printout with "good" exceptions stack traces.
| Constructor Summary | |
|---|---|
SystemStreamUtil()
|
|
| Method Summary | |
|---|---|
static String |
getSystemErr()
Returns buffer accumulated with data as string. |
static String |
getSystemOut()
Returns buffer accumulated with data as string. |
static void |
replaceError()
Replaces System.err with internal buffer. |
static void |
replaceOut()
Replaces System.out with internal buffer. |
static void |
restoreSystemErr()
Restores System.err to former glory. |
static void |
restoreSystemOut()
Restores System.out to former glory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SystemStreamUtil()
| Method Detail |
|---|
public static void replaceOut()
System.out with internal buffer. All calls such as System.out.print...
will go to this buffer and not to STDIO
public static String getSystemOut()
public static void restoreSystemOut()
System.out to former glory.
public static void replaceError()
System.err with internal buffer. All calls such as System.err.print...
will go to this buffer and not to STDERR
public static String getSystemErr()
public static void restoreSystemErr()
System.err to former glory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||