Package org.apache.uima.fit.testing.util
Class HideOutput
java.lang.Object
org.apache.uima.fit.testing.util.HideOutput
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
-
Constructor Summary
ConstructorDescriptioncalling this constructor will silence System.out and System.err untilrestoreOutput()
is called by setting them to this OutputStream -
Method Summary
Modifier and TypeMethodDescriptionvoid
this method restores System.out and System.err
-
Field Details
-
out
-
err
-
-
Constructor Details
-
HideOutput
public HideOutput()calling this constructor will silence System.out and System.err untilrestoreOutput()
is called by setting them to this OutputStream
-
-
Method Details
-
restoreOutput
public void restoreOutput()this method restores System.out and System.err
-