Class MutableTestExecutionSummary
- java.lang.Object
-
- org.junit.platform.launcher.listeners.MutableTestExecutionSummary
-
- All Implemented Interfaces:
TestExecutionSummary
class MutableTestExecutionSummary extends java.lang.Object implements TestExecutionSummary
Mutable, internal implementation of theTestExecutionSummary
API.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MutableTestExecutionSummary.DefaultFailure
-
Nested classes/interfaces inherited from interface org.junit.platform.launcher.listeners.TestExecutionSummary
TestExecutionSummary.Failure
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CAUSED_BY
private static java.lang.String
CIRCULAR
(package private) java.util.concurrent.atomic.AtomicLong
containersAborted
(package private) java.util.concurrent.atomic.AtomicLong
containersFailed
(package private) java.util.concurrent.atomic.AtomicLong
containersFound
(package private) java.util.concurrent.atomic.AtomicLong
containersSkipped
(package private) java.util.concurrent.atomic.AtomicLong
containersStarted
(package private) java.util.concurrent.atomic.AtomicLong
containersSucceeded
private static int
DEFAULT_MAX_STACKTRACE_LINES
private static java.lang.String
DOUBLE_TAB
private java.util.List<TestExecutionSummary.Failure>
failures
private static java.lang.String
SUPPRESSED
private static java.lang.String
TAB
private TestPlan
testPlan
(package private) java.util.concurrent.atomic.AtomicLong
testsAborted
(package private) java.util.concurrent.atomic.AtomicLong
testsFailed
(package private) java.util.concurrent.atomic.AtomicLong
testsFound
(package private) java.util.concurrent.atomic.AtomicLong
testsSkipped
(package private) java.util.concurrent.atomic.AtomicLong
testsStarted
(package private) java.util.concurrent.atomic.AtomicLong
testsSucceeded
(package private) long
timeFinished
(package private) long
timeFinishedNanos
private long
timeStarted
private long
timeStartedNanos
-
Constructor Summary
Constructors Constructor Description MutableTestExecutionSummary(TestPlan testPlan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addFailure(TestIdentifier testIdentifier, java.lang.Throwable throwable)
private void
collectTestDescription(TestIdentifier identifier, java.util.List<java.lang.String> descriptionParts)
private java.lang.String
describeTest(TestIdentifier testIdentifier)
long
getContainersAbortedCount()
Get the number of containers aborted.long
getContainersFailedCount()
Get the number of containers that failed.long
getContainersFoundCount()
Get the number of containers found.long
getContainersSkippedCount()
Get the number of containers skipped.long
getContainersStartedCount()
Get the number of containers started.long
getContainersSucceededCount()
Get the number of containers that succeeded.java.util.List<TestExecutionSummary.Failure>
getFailures()
Get an immutable list of the failures of the test plan execution.long
getTestsAbortedCount()
Get the number of tests aborted.long
getTestsFailedCount()
Get the number of tests that failed.long
getTestsFoundCount()
Get the number of tests found.long
getTestsSkippedCount()
Get the number of tests skipped.long
getTestsStartedCount()
Get the number of tests started.long
getTestsSucceededCount()
Get the number of tests that succeeded.long
getTimeFinished()
Get the timestamp (in milliseconds) when the test plan finished.long
getTimeStarted()
Get the timestamp (in milliseconds) when the test plan started.long
getTotalFailureCount()
Get the total number of failed containers and failed tests.private int
numberOfCommonFrames(java.lang.StackTraceElement[] currentTrace, java.lang.StackTraceElement[] parentTrace)
void
printFailuresTo(java.io.PrintWriter writer)
Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.void
printFailuresTo(java.io.PrintWriter writer, int maxStackTraceLines)
Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter
.private void
printSource(java.io.PrintWriter writer, TestIdentifier testIdentifier)
private void
printStackTrace(java.io.PrintWriter writer, java.lang.StackTraceElement[] parentTrace, java.lang.Throwable throwable, java.lang.String caption, java.lang.String indentation, java.util.Set<java.lang.Throwable> seenThrowables, int max)
private void
printStackTrace(java.io.PrintWriter writer, java.lang.Throwable throwable, int max)
void
printTo(java.io.PrintWriter writer)
Print this summary to the suppliedPrintWriter
.
-
-
-
Field Detail
-
TAB
private static final java.lang.String TAB
- See Also:
- Constant Field Values
-
DOUBLE_TAB
private static final java.lang.String DOUBLE_TAB
- See Also:
- Constant Field Values
-
DEFAULT_MAX_STACKTRACE_LINES
private static final int DEFAULT_MAX_STACKTRACE_LINES
- See Also:
- Constant Field Values
-
CAUSED_BY
private static final java.lang.String CAUSED_BY
- See Also:
- Constant Field Values
-
SUPPRESSED
private static final java.lang.String SUPPRESSED
- See Also:
- Constant Field Values
-
CIRCULAR
private static final java.lang.String CIRCULAR
- See Also:
- Constant Field Values
-
containersFound
final java.util.concurrent.atomic.AtomicLong containersFound
-
containersStarted
final java.util.concurrent.atomic.AtomicLong containersStarted
-
containersSkipped
final java.util.concurrent.atomic.AtomicLong containersSkipped
-
containersAborted
final java.util.concurrent.atomic.AtomicLong containersAborted
-
containersSucceeded
final java.util.concurrent.atomic.AtomicLong containersSucceeded
-
containersFailed
final java.util.concurrent.atomic.AtomicLong containersFailed
-
testsFound
final java.util.concurrent.atomic.AtomicLong testsFound
-
testsStarted
final java.util.concurrent.atomic.AtomicLong testsStarted
-
testsSkipped
final java.util.concurrent.atomic.AtomicLong testsSkipped
-
testsAborted
final java.util.concurrent.atomic.AtomicLong testsAborted
-
testsSucceeded
final java.util.concurrent.atomic.AtomicLong testsSucceeded
-
testsFailed
final java.util.concurrent.atomic.AtomicLong testsFailed
-
testPlan
private final TestPlan testPlan
-
failures
private final java.util.List<TestExecutionSummary.Failure> failures
-
timeStarted
private final long timeStarted
-
timeStartedNanos
private final long timeStartedNanos
-
timeFinished
long timeFinished
-
timeFinishedNanos
long timeFinishedNanos
-
-
Constructor Detail
-
MutableTestExecutionSummary
MutableTestExecutionSummary(TestPlan testPlan)
-
-
Method Detail
-
addFailure
void addFailure(TestIdentifier testIdentifier, java.lang.Throwable throwable)
-
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:
TestExecutionSummary.getTestsFailedCount()
,TestExecutionSummary.getContainersFailedCount()
-
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:
TestExecutionSummary.getTestsFailedCount()
,TestExecutionSummary.getTotalFailureCount()
-
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:
TestExecutionSummary.getContainersFailedCount()
,TestExecutionSummary.getTotalFailureCount()
-
printTo
public void printTo(java.io.PrintWriter writer)
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:
TestExecutionSummary.printFailuresTo(PrintWriter)
-
printFailuresTo
public void printFailuresTo(java.io.PrintWriter writer)
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:
TestExecutionSummary.printTo(PrintWriter)
,TestExecutionSummary.printFailuresTo(PrintWriter, int)
-
printFailuresTo
public void printFailuresTo(java.io.PrintWriter writer, int maxStackTraceLines)
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:
TestExecutionSummary.printTo(PrintWriter)
,TestExecutionSummary.printFailuresTo(PrintWriter)
-
getFailures
public java.util.List<TestExecutionSummary.Failure> getFailures()
Description copied from interface:TestExecutionSummary
Get an immutable list of the failures of the test plan execution.- Specified by:
getFailures
in interfaceTestExecutionSummary
-
describeTest
private java.lang.String describeTest(TestIdentifier testIdentifier)
-
collectTestDescription
private void collectTestDescription(TestIdentifier identifier, java.util.List<java.lang.String> descriptionParts)
-
printSource
private void printSource(java.io.PrintWriter writer, TestIdentifier testIdentifier)
-
printStackTrace
private void printStackTrace(java.io.PrintWriter writer, java.lang.Throwable throwable, int max)
-
printStackTrace
private void printStackTrace(java.io.PrintWriter writer, java.lang.StackTraceElement[] parentTrace, java.lang.Throwable throwable, java.lang.String caption, java.lang.String indentation, java.util.Set<java.lang.Throwable> seenThrowables, int max)
-
numberOfCommonFrames
private int numberOfCommonFrames(java.lang.StackTraceElement[] currentTrace, java.lang.StackTraceElement[] parentTrace)
-
-