Package dev.enola.cli
Class SystemOutErrCapture
java.lang.Object
dev.enola.cli.SystemOutErrCapture
- All Implemented Interfaces:
AutoCloseable
Utility to capture System.out and System.err in unit tests. Note that this doesn't work well
together with code which keeps references to System.out/err in a static, such as JUL; see
EnolaTest.
-
Constructor Details
-
SystemOutErrCapture
public SystemOutErrCapture()
-
-
Method Details
-
getSystemOut
-
getSystemErr
-
clear
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-