Interface TestEventReporter
- All Superinterfaces:
- AutoCloseable
- All Known Subinterfaces:
- GroupTestEventReporter
- Since:
- 8.12
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close the generator.default voidEmit a failure event for the test.default voidEmit a failure event for the test.voidEmit a failure event for the test.voidEmit an event containing metadata about the test or test group currently being run.voidEmit an event containing metadata about the test or test group currently being run.voidoutput(Instant logTime, TestOutputEvent.Destination destination, String output) Emit an output event for the test.voidEmit a skipped event for the test.voidEmit a start event for the test.voidEmit a successful completion event for the test.
- 
Method Details- 
startedEmit a start event for the test. Can only be called once, and must be followed by a call tosucceeded(Instant),skipped(Instant),failed(Instant), orfailed(Instant, String).- Parameters:
- startTime- the time the test started
- Since:
- 8.12
 
- 
outputEmit an output event for the test. May be called multiple times. May not be called beforestarted(Instant).- Parameters:
- logTime- the time the output was logged, must be between the start and end times of the test
- destination- the destination of the output
- output- some output from the test
- Since:
- 8.12
 
- 
metadataEmit an event containing metadata about the test or test group currently being run.Producers can supply the same value as the test start time to indicate that the metadata is "timeless", such as environment information that isn't tied to a specific point during test execution. Otherwise, the time should be between the start and end times of the test (inclusive), but this is not enforced. Keys should usually be unique within the scope of a single test, but this is not enforced. - Parameters:
- logTime- the time the metadata was logged, should be between the start and end times of the test (inclusive)
- key- a key to identify the metadata
- value- the metadata value, which must be serializable by the Tooling API
- Since:
- 8.13
 
- 
metadataEmit an event containing metadata about the test or test group currently being run. The metadata is a map containing potentially multiple key-value pairs to be reported to any consumer as a single event.Producers can supply the same value as the test start time to indicate that the metadata is "timeless", such as environment information that isn't tied to a specific point during test execution. Otherwise, the time should be between the start and end times of the test (inclusive), but this is not enforced. Keys should usually be unique within the scope of a single test, but this is not enforced. - Parameters:
- logTime- the time the metadata was logged, should be between the start and end times of the test (inclusive)
- values- the metadata values, containing in a map which must be serializable by the Tooling API
- Since:
- 8.13
 
- 
succeededEmit a successful completion event for the test. May not be called beforestarted(Instant).- Parameters:
- endTime- the time the test completed
- Since:
- 8.12
 
- 
skippedEmit a skipped event for the test. May not be called beforestarted(Instant).- Parameters:
- endTime- the time the test completed
- Since:
- 8.12
 
- 
failedEmit a failure event for the test. May not be called beforestarted(Instant).- Parameters:
- endTime- the time the test completed
- Since:
- 8.12
 
- 
failedEmit a failure event for the test. May not be called beforestarted(Instant).- Parameters:
- endTime- the time the test completed
- message- the failure message
- Since:
- 8.12
 
- 
failedEmit a failure event for the test. May not be called beforestarted(Instant).- Parameters:
- endTime- the time the test completed
- message- the failure message
- additionalContent- additional content for the failure, like a stacktrace
- Since:
- 8.12
 
- 
closevoid close()Close the generator. No further events can be emitted after this.- Specified by:
- closein interface- AutoCloseable
- Since:
- 8.12
 
 
-