Class OutputCatcher

java.lang.Object
org.h2.test.utils.OutputCatcher

public class OutputCatcher extends Object
A 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 Details

    • START_ERROR

      public static final String START_ERROR
      The HTML text will contain this string if something was written to System.err.
      See Also:
  • Method Details

    • stop

      public void stop()
      Stop catching output.
    • writeTo

      public void writeTo(String title, String fileName) throws IOException
      Write the output to a HTML file.
      Parameters:
      title - the title
      fileName - the file name
      Throws:
      IOException
    • start

      public static OutputCatcher start()
      Create a new output catcher and start it.
      Returns:
      the output catcher