Class OutputCapture
java.lang.Object
com.github.sbt.junit.jupiter.internal.listeners.OutputCapture
Hijacks the systems standard output and error streams on a per-thread basis and redirects to
given streams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeregister streams for the current thread, and restore the previous if any.static voidinstall(StreamPair system) Possibly installs delegating print streams.static voidregister(PrintStream out, PrintStream err) Register streams for the current thread.static voidPossibly restores the original print streams.
-
Constructor Details
-
OutputCapture
public OutputCapture()
-
-
Method Details
-
install
Possibly installs delegating print streams.Checks whether the current thread is the first thread to install output capturing. If
true, the original print streams will be overwritten by custom, delegating print streams.In any case this method stores the specified
systemstream pair, so that it can be successfully restored later on.- Parameters:
system- A stream pair containing the original system streams.- See Also:
-
uninstall
public static void uninstall()Possibly restores the original print streams.Checks whether the current thread is the last thread which previously installed output capturing. If
true, then the original print streams will be restored.- See Also:
-
register
Register streams for the current thread.- Parameters:
out- The standard output stream which is to be registered.err- The error stream which is to be registered.- Throws:
IllegalStateException- If output capturing has not been installed.
-
deregister
public static void deregister()Deregister streams for the current thread, and restore the previous if any.
-