org.apache.uima.fit.testing.util

## Class HideOutput

- java.lang.Object
- - org.apache.uima.fit.testing.util.HideOutput

-     public class HideOutput
      extends Object

  This class provides a way to hide output sent to System.out and System.err. This may be useful when testing code that creates a lot of noisy output that can be ignored for testing purposes. This class works by redirecting System.out and System.err - note that this may have unintended side effects if you are not careful to call `restoreOutput()` after the noisy code. Intended usage: `HideOutput hider = new HideOutput(); try { ... noisy code ... } finally { hider.restoreOutput(); }`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PrintStream` | `err`
    `protected PrintStream` | `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HideOutput()` calling this constructor will silence System.out and System.err until `restoreOutput()` is called by setting them to this OutputStream

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `restoreOutput()` this method restores System.out and System.err

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

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

- - ### Field Detail

    - #### out

          protected PrintStream out

    - #### err

          protected PrintStream err

  - ### Constructor Detail

    - #### HideOutput

          public HideOutput()

      calling this constructor will silence System.out and System.err until `restoreOutput()` is called by setting them to this OutputStream

  - ### Method Detail

    - #### restoreOutput

          public void restoreOutput()

      this method restores System.out and System.err

Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.