Package org.h2.test.utils

# 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 Summary

Fields
Modifier and Type
Field
Description
`static final String`
`START_ERROR`
The HTML text will contain this string if something was written to System.err.

## Method Summary

Modifier and Type
Method
Description
`static OutputCatcher`
`start()`
Create a new output catcher and start it.
`void`
`stop()`
Stop catching output.
`void`
`writeTo(String title, String fileName)`
Write the output to a HTML file.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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:
  - Constant Field Values

## 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