Interface TestResultFormatter
- All Superinterfaces:
AutoCloseable,Closeable,org.junit.platform.launcher.TestExecutionListener
public interface TestResultFormatter
extends org.junit.platform.launcher.TestExecutionListener, Closeable
A
TestExecutionListener which lets implementing classes
format and write out the test execution results.-
Method Summary
Modifier and TypeMethodDescriptionvoidsetContext(TestExecutionContext context) This method will be invoked by thejunitlauncherand will be passed aTestExecutionContext.voidThis method will be invoked by thejunitlauncherand will be passed theOutputStreamto a file, to which the formatted result is expected to be written to.voidsetUseLegacyReportingName(boolean useLegacyReportingName) This method will be invoked by thejunitlauncherto let the result formatter implementation know whether or not to use JUnit 4 style, legacy reporting names for test identifiers that get displayed in the test reports.default voidsysErrAvailable(byte[] data) This method will be invoked by thejunitlauncher, regularly/multiple times, as and when any content is generated on the standard error stream during the test execution.default voidsysOutAvailable(byte[] data) This method will be invoked by thejunitlauncher, regularly/multiple times, as and when any content is generated on the standard output stream during the test execution.Methods inherited from interface org.junit.platform.launcher.TestExecutionListener
dynamicTestRegistered, executionFinished, executionSkipped, executionStarted, reportingEntryPublished, testPlanExecutionFinished, testPlanExecutionStarted
-
Method Details
-
setDestination
This method will be invoked by thejunitlauncherand will be passed theOutputStreamto 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.- Parameters:
os- The output stream to which to write out the result
-
setContext
This method will be invoked by thejunitlauncherand will be passed aTestExecutionContext. This allows theTestResultFormatterto have access to any additional contextual information to use in the test reports.- Parameters:
context- The context of the execution of the test
-
setUseLegacyReportingName
void setUseLegacyReportingName(boolean useLegacyReportingName) This method will be invoked by thejunitlauncherto let the result formatter implementation know whether or not to use JUnit 4 style, legacy reporting names for test identifiers that get displayed in the test reports. Result formatter implementations are allowed to default to a specific reporting style for test identifiers, if this method isn't invoked.- Parameters:
useLegacyReportingName-trueif legacy reporting name is to be used,falseotherwise.- Since:
- Ant 1.10.10
-
sysOutAvailable
default void sysOutAvailable(byte[] data) This method will be invoked by thejunitlauncher, 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 thesendSysOutattribute of thelistener, to which thisTestResultFormatteris configured for, is enabled- Parameters:
data- The content generated on standard output stream
-
sysErrAvailable
default void sysErrAvailable(byte[] data) This method will be invoked by thejunitlauncher, 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 thesendSysErrattribute of thelistener, to which thisTestResultFormatteris configured for, is enabled- Parameters:
data- The content generated on standard error stream
-