Package org.javalite.test
Class SystemStreamUtil
java.lang.Object
org.javalite.test.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.
- Author:
- Igor Polevoy: 3/5/12 12:25 PM
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns buffer accumulated with data as string.static StringReturns buffer accumulated with data as string.static voidReplacesSystem.errwith internal buffer.static voidReplacesSystem.outwith internal buffer.static voidRestoresSystem.errto former glory.static voidRestoresSystem.outto former glory.
-
Method Details
-
replaceOut
public static void replaceOut()ReplacesSystem.outwith internal buffer. All calls such asSystem.out.print...will go to this buffer and not to STDIO -
getSystemOut
Returns buffer accumulated with data as string.- Returns:
- buffer accumulated with data as string.
-
restoreSystemOut
public static void restoreSystemOut()RestoresSystem.outto former glory. -
replaceError
public static void replaceError()ReplacesSystem.errwith internal buffer. All calls such asSystem.err.print...will go to this buffer and not to STDERR -
getSystemErr
Returns buffer accumulated with data as string.- Returns:
- buffer accumulated with data as string.
-
restoreSystemErr
public static void restoreSystemErr()RestoresSystem.errto former glory.
-