Package org.javalite.test
Class SystemStreamUtil
- java.lang.Object
-
- org.javalite.test.SystemStreamUtil
-
public class SystemStreamUtil extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetSystemErr()Returns buffer accumulated with data as string.static StringgetSystemOut()Returns buffer accumulated with data as string.static voidreplaceError()ReplacesSystem.errwith internal buffer.static voidreplaceOut()ReplacesSystem.outwith internal buffer.static voidrestoreSystemErr()RestoresSystem.errto former glory.static voidrestoreSystemOut()RestoresSystem.outto former glory.
-
-
-
Method Detail
-
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
public static String 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
public static String getSystemErr()
Returns buffer accumulated with data as string.- Returns:
- buffer accumulated with data as string.
-
restoreSystemErr
public static void restoreSystemErr()
RestoresSystem.errto former glory.
-
-