Class MutableTestExecutionSummary
java.lang.Object
org.junit.platform.launcher.listeners.MutableTestExecutionSummary
- All Implemented Interfaces:
TestExecutionSummary
Mutable, internal implementation of the
TestExecutionSummary
API.- Since:
- 1.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.junit.platform.launcher.listeners.TestExecutionSummary
TestExecutionSummary.Failure
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
private static final int
private static final String
private final List
<TestExecutionSummary.Failure> private static final String
private static final String
private final TestPlan
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) final AtomicLong
(package private) long
(package private) long
private final long
private final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addFailure
(TestIdentifier testIdentifier, Throwable throwable) private void
collectTestDescription
(TestIdentifier identifier, List<String> descriptionParts) private String
describeTest
(TestIdentifier testIdentifier) long
Get the number of containers aborted.long
Get the number of containers that failed.long
Get the number of containers found.long
Get the number of containers skipped.long
Get the number of containers started.long
Get the number of containers that succeeded.Get an immutable list of the failures of the test plan execution.long
Get the number of tests aborted.long
Get the number of tests that failed.long
Get the number of tests found.long
Get the number of tests skipped.long
Get the number of tests started.long
Get the number of tests that succeeded.long
Get the timestamp (in milliseconds) when the test plan finished.long
Get the timestamp (in milliseconds) when the test plan started.long
Get the total number of failed containers and failed tests.private int
numberOfCommonFrames
(StackTraceElement[] currentTrace, StackTraceElement[] parentTrace) void
printFailuresTo
(PrintWriter writer) Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.void
printFailuresTo
(PrintWriter writer, int maxStackTraceLines) Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.private void
printSource
(PrintWriter writer, TestIdentifier testIdentifier) private void
printStackTrace
(PrintWriter writer, StackTraceElement[] parentTrace, Throwable throwable, String caption, String indentation, Set<Throwable> seenThrowables, int max) private void
printStackTrace
(PrintWriter writer, Throwable throwable, int max) void
printTo
(PrintWriter writer) Print this summary to the suppliedPrintWriter
.
-
Field Details
-
TAB
- See Also:
-
DOUBLE_TAB
- See Also:
-
DEFAULT_MAX_STACKTRACE_LINES
private static final int DEFAULT_MAX_STACKTRACE_LINES- See Also:
-
CAUSED_BY
- See Also:
-
SUPPRESSED
- See Also:
-
CIRCULAR
- See Also:
-
containersFound
-
containersStarted
-
containersSkipped
-
containersAborted
-
containersSucceeded
-
containersFailed
-
testsFound
-
testsStarted
-
testsSkipped
-
testsAborted
-
testsSucceeded
-
testsFailed
-
testPlan
-
failures
-
timeStarted
private final long timeStarted -
timeStartedNanos
private final long timeStartedNanos -
timeFinished
long timeFinished -
timeFinishedNanos
long timeFinishedNanos
-
-
Constructor Details
-
MutableTestExecutionSummary
MutableTestExecutionSummary(TestPlan testPlan)
-
-
Method Details
-
addFailure
-
getTimeStarted
public long getTimeStarted()Description copied from interface:TestExecutionSummary
Get the timestamp (in milliseconds) when the test plan started.- Specified by:
getTimeStarted
in interfaceTestExecutionSummary
-
getTimeFinished
public long getTimeFinished()Description copied from interface:TestExecutionSummary
Get the timestamp (in milliseconds) when the test plan finished.- Specified by:
getTimeFinished
in interfaceTestExecutionSummary
-
getTotalFailureCount
public long getTotalFailureCount()Description copied from interface:TestExecutionSummary
Get the total number of failed containers and failed tests.- Specified by:
getTotalFailureCount
in interfaceTestExecutionSummary
- See Also:
-
getContainersFoundCount
public long getContainersFoundCount()Description copied from interface:TestExecutionSummary
Get the number of containers found.- Specified by:
getContainersFoundCount
in interfaceTestExecutionSummary
-
getContainersStartedCount
public long getContainersStartedCount()Description copied from interface:TestExecutionSummary
Get the number of containers started.- Specified by:
getContainersStartedCount
in interfaceTestExecutionSummary
-
getContainersSkippedCount
public long getContainersSkippedCount()Description copied from interface:TestExecutionSummary
Get the number of containers skipped.- Specified by:
getContainersSkippedCount
in interfaceTestExecutionSummary
-
getContainersAbortedCount
public long getContainersAbortedCount()Description copied from interface:TestExecutionSummary
Get the number of containers aborted.- Specified by:
getContainersAbortedCount
in interfaceTestExecutionSummary
-
getContainersSucceededCount
public long getContainersSucceededCount()Description copied from interface:TestExecutionSummary
Get the number of containers that succeeded.- Specified by:
getContainersSucceededCount
in interfaceTestExecutionSummary
-
getContainersFailedCount
public long getContainersFailedCount()Description copied from interface:TestExecutionSummary
Get the number of containers that failed.- Specified by:
getContainersFailedCount
in interfaceTestExecutionSummary
- See Also:
-
getTestsFoundCount
public long getTestsFoundCount()Description copied from interface:TestExecutionSummary
Get the number of tests found.- Specified by:
getTestsFoundCount
in interfaceTestExecutionSummary
-
getTestsStartedCount
public long getTestsStartedCount()Description copied from interface:TestExecutionSummary
Get the number of tests started.- Specified by:
getTestsStartedCount
in interfaceTestExecutionSummary
-
getTestsSkippedCount
public long getTestsSkippedCount()Description copied from interface:TestExecutionSummary
Get the number of tests skipped.- Specified by:
getTestsSkippedCount
in interfaceTestExecutionSummary
-
getTestsAbortedCount
public long getTestsAbortedCount()Description copied from interface:TestExecutionSummary
Get the number of tests aborted.- Specified by:
getTestsAbortedCount
in interfaceTestExecutionSummary
-
getTestsSucceededCount
public long getTestsSucceededCount()Description copied from interface:TestExecutionSummary
Get the number of tests that succeeded.- Specified by:
getTestsSucceededCount
in interfaceTestExecutionSummary
-
getTestsFailedCount
public long getTestsFailedCount()Description copied from interface:TestExecutionSummary
Get the number of tests that failed.- Specified by:
getTestsFailedCount
in interfaceTestExecutionSummary
- See Also:
-
printTo
Description copied from interface:TestExecutionSummary
Print this summary to the suppliedPrintWriter
.This method does not print failure messages.
- Specified by:
printTo
in interfaceTestExecutionSummary
- See Also:
-
printFailuresTo
Description copied from interface:TestExecutionSummary
Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.- Specified by:
printFailuresTo
in interfaceTestExecutionSummary
- Parameters:
writer
- thePrintWriter
to which to print; nevernull
- See Also:
-
printFailuresTo
Description copied from interface:TestExecutionSummary
Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.The maximum number of lines to print for exception stack traces (if any) can be specified via the
maxStackTraceLines
argument.By default, this method delegates to
TestExecutionSummary.printFailuresTo(PrintWriter)
, effectively ignoring themaxStackTraceLines
argument. Concrete implementations of this interface should therefore override this default method in order to honor themaxStackTraceLines
argument.- Specified by:
printFailuresTo
in interfaceTestExecutionSummary
- Parameters:
writer
- thePrintWriter
to which to print; nevernull
maxStackTraceLines
- the maximum number of lines to print for exception stack traces; must be a positive value- See Also:
-
getFailures
Description copied from interface:TestExecutionSummary
Get an immutable list of the failures of the test plan execution.- Specified by:
getFailures
in interfaceTestExecutionSummary
-
describeTest
-
collectTestDescription
-
printSource
-
printStackTrace
-
printStackTrace
private void printStackTrace(PrintWriter writer, StackTraceElement[] parentTrace, Throwable throwable, String caption, String indentation, Set<Throwable> seenThrowables, int max) -
numberOfCommonFrames
-