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 Details

  • Constructor Details

    • HideOutput

      public HideOutput()
      calling this constructor will silence System.out and System.err until restoreOutput() is called by setting them to this OutputStream
  • Method Details

    • restoreOutput

      public void restoreOutput()
      this method restores System.out and System.err