Package org.h2.test.utils
Class OutputCatcher
- java.lang.Object
-
- org.h2.test.utils.OutputCatcher
-
public class OutputCatcher extends java.lang.ObjectA tool to capture the output of System.out and System.err. The regular output still occurs, but it is additionally available as a String.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSTART_ERRORThe HTML text will contain this string if something was written to System.err.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OutputCatcherstart()Create a new output catcher and start it.voidstop()Stop catching output.voidwriteTo(java.lang.String title, java.lang.String fileName)Write the output to a HTML file.
-
-
-
Field Detail
-
START_ERROR
public static final java.lang.String START_ERROR
The HTML text will contain this string if something was written to System.err.- See Also:
- Constant Field Values
-
-
Method Detail
-
stop
public void stop()
Stop catching output.
-
writeTo
public void writeTo(java.lang.String title, java.lang.String fileName) throws java.io.IOExceptionWrite the output to a HTML file.- Parameters:
title- the titlefileName- the file name- Throws:
java.io.IOException
-
start
public static OutputCatcher start()
Create a new output catcher and start it.- Returns:
- the output catcher
-
-