java.lang.AutoCloseable
, java.io.Closeable
, org.junit.platform.launcher.TestExecutionListener
public interface TestResultFormatter
extends org.junit.platform.launcher.TestExecutionListener, java.io.Closeable
TestExecutionListener
which lets implementing classes
format and write out the test execution results.Modifier and Type | Method | Description |
---|---|---|
void |
setContext(TestExecutionContext context) |
This method will be invoked by the
junitlauncher and will be passed a
TestExecutionContext . |
void |
setDestination(java.io.OutputStream os) |
This method will be invoked by the
junitlauncher and will be passed the
OutputStream to a file, to which the formatted result is expected to be written
to. |
default void |
sysErrAvailable(byte[] data) |
This method will be invoked by the
junitlauncher , regularly/multiple times,
as and when any content is generated on the standard error stream during the test execution. |
default void |
sysOutAvailable(byte[] data) |
This method will be invoked by the
junitlauncher , regularly/multiple times,
as and when any content is generated on the standard output stream during the test execution. |
void setDestination(java.io.OutputStream os)
junitlauncher
and will be passed the
OutputStream
to a file, to which the formatted result is expected to be written
to.
This method will be called once, early on, during the initialization of this
TestResultFormatter
, typically before the test execution itself has started.
os
- The output stream to which to write out the resultvoid setContext(TestExecutionContext context)
junitlauncher
and will be passed a
TestExecutionContext
. This allows the TestResultFormatter
to have access
to any additional contextual information to use in the test reports.context
- The context of the execution of the testdefault void sysOutAvailable(byte[] data)
junitlauncher
, regularly/multiple times,
as and when any content is generated on the standard output stream during the test execution.
This method will be only be called if the sendSysOut
attribute of the listener
,
to which this TestResultFormatter
is configured for, is enableddata
- The content generated on standard output streamdefault void sysErrAvailable(byte[] data)
junitlauncher
, regularly/multiple times,
as and when any content is generated on the standard error stream during the test execution.
This method will be only be called if the sendSysErr
attribute of the listener
,
to which this TestResultFormatter
is configured for, is enableddata
- The content generated on standard error stream