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 theTestExecutionSummaryAPI.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classMutableTestExecutionSummary.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.StringCAUSED_BYprivate static java.lang.StringCIRCULAR(package private) java.util.concurrent.atomic.AtomicLongcontainersAborted(package private) java.util.concurrent.atomic.AtomicLongcontainersFailed(package private) java.util.concurrent.atomic.AtomicLongcontainersFound(package private) java.util.concurrent.atomic.AtomicLongcontainersSkipped(package private) java.util.concurrent.atomic.AtomicLongcontainersStarted(package private) java.util.concurrent.atomic.AtomicLongcontainersSucceededprivate static intDEFAULT_MAX_STACKTRACE_LINESprivate static java.lang.StringDOUBLE_TABprivate java.util.List<TestExecutionSummary.Failure>failuresprivate static java.lang.StringSUPPRESSEDprivate static java.lang.StringTABprivate TestPlantestPlan(package private) java.util.concurrent.atomic.AtomicLongtestsAborted(package private) java.util.concurrent.atomic.AtomicLongtestsFailed(package private) java.util.concurrent.atomic.AtomicLongtestsFound(package private) java.util.concurrent.atomic.AtomicLongtestsSkipped(package private) java.util.concurrent.atomic.AtomicLongtestsStarted(package private) java.util.concurrent.atomic.AtomicLongtestsSucceeded(package private) longtimeFinishedprivate longtimeStarted
-
Constructor Summary
Constructors Constructor Description MutableTestExecutionSummary(TestPlan testPlan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddFailure(TestIdentifier testIdentifier, java.lang.Throwable throwable)private voidcollectTestDescription(TestIdentifier identifier, java.util.List<java.lang.String> descriptionParts)private java.lang.StringdescribeTest(TestIdentifier testIdentifier)longgetContainersAbortedCount()Get the number of containers aborted.longgetContainersFailedCount()Get the number of containers that failed.longgetContainersFoundCount()Get the number of containers found.longgetContainersSkippedCount()Get the number of containers skipped.longgetContainersStartedCount()Get the number of containers started.longgetContainersSucceededCount()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.longgetTestsAbortedCount()Get the number of tests aborted.longgetTestsFailedCount()Get the number of tests that failed.longgetTestsFoundCount()Get the number of tests found.longgetTestsSkippedCount()Get the number of tests skipped.longgetTestsStartedCount()Get the number of tests started.longgetTestsSucceededCount()Get the number of tests that succeeded.longgetTimeFinished()Get the timestamp (in milliseconds) when the test plan finished.longgetTimeStarted()Get the timestamp (in milliseconds) when the test plan started.longgetTotalFailureCount()Get the total number of failed containers and failed tests.private intnumberOfCommonFrames(java.lang.StackTraceElement[] currentTrace, java.lang.StackTraceElement[] parentTrace)voidprintFailuresTo(java.io.PrintWriter writer)Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter.voidprintFailuresTo(java.io.PrintWriter writer, int maxStackTraceLines)Print failed containers and tests, including sources and exception messages, to the suppliedPrintWriter.private voidprintSource(java.io.PrintWriter writer, TestIdentifier testIdentifier)private voidprintStackTrace(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 voidprintStackTrace(java.io.PrintWriter writer, java.lang.Throwable throwable, int max)voidprintTo(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
-
timeFinished
long timeFinished
-
-
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:TestExecutionSummaryGet the timestamp (in milliseconds) when the test plan started.- Specified by:
getTimeStartedin interfaceTestExecutionSummary
-
getTimeFinished
public long getTimeFinished()
Description copied from interface:TestExecutionSummaryGet the timestamp (in milliseconds) when the test plan finished.- Specified by:
getTimeFinishedin interfaceTestExecutionSummary
-
getTotalFailureCount
public long getTotalFailureCount()
Description copied from interface:TestExecutionSummaryGet the total number of failed containers and failed tests.- Specified by:
getTotalFailureCountin interfaceTestExecutionSummary- See Also:
TestExecutionSummary.getTestsFailedCount(),TestExecutionSummary.getContainersFailedCount()
-
getContainersFoundCount
public long getContainersFoundCount()
Description copied from interface:TestExecutionSummaryGet the number of containers found.- Specified by:
getContainersFoundCountin interfaceTestExecutionSummary
-
getContainersStartedCount
public long getContainersStartedCount()
Description copied from interface:TestExecutionSummaryGet the number of containers started.- Specified by:
getContainersStartedCountin interfaceTestExecutionSummary
-
getContainersSkippedCount
public long getContainersSkippedCount()
Description copied from interface:TestExecutionSummaryGet the number of containers skipped.- Specified by:
getContainersSkippedCountin interfaceTestExecutionSummary
-
getContainersAbortedCount
public long getContainersAbortedCount()
Description copied from interface:TestExecutionSummaryGet the number of containers aborted.- Specified by:
getContainersAbortedCountin interfaceTestExecutionSummary
-
getContainersSucceededCount
public long getContainersSucceededCount()
Description copied from interface:TestExecutionSummaryGet the number of containers that succeeded.- Specified by:
getContainersSucceededCountin interfaceTestExecutionSummary
-
getContainersFailedCount
public long getContainersFailedCount()
Description copied from interface:TestExecutionSummaryGet the number of containers that failed.- Specified by:
getContainersFailedCountin interfaceTestExecutionSummary- See Also:
TestExecutionSummary.getTestsFailedCount(),TestExecutionSummary.getTotalFailureCount()
-
getTestsFoundCount
public long getTestsFoundCount()
Description copied from interface:TestExecutionSummaryGet the number of tests found.- Specified by:
getTestsFoundCountin interfaceTestExecutionSummary
-
getTestsStartedCount
public long getTestsStartedCount()
Description copied from interface:TestExecutionSummaryGet the number of tests started.- Specified by:
getTestsStartedCountin interfaceTestExecutionSummary
-
getTestsSkippedCount
public long getTestsSkippedCount()
Description copied from interface:TestExecutionSummaryGet the number of tests skipped.- Specified by:
getTestsSkippedCountin interfaceTestExecutionSummary
-
getTestsAbortedCount
public long getTestsAbortedCount()
Description copied from interface:TestExecutionSummaryGet the number of tests aborted.- Specified by:
getTestsAbortedCountin interfaceTestExecutionSummary
-
getTestsSucceededCount
public long getTestsSucceededCount()
Description copied from interface:TestExecutionSummaryGet the number of tests that succeeded.- Specified by:
getTestsSucceededCountin interfaceTestExecutionSummary
-
getTestsFailedCount
public long getTestsFailedCount()
Description copied from interface:TestExecutionSummaryGet the number of tests that failed.- Specified by:
getTestsFailedCountin interfaceTestExecutionSummary- See Also:
TestExecutionSummary.getContainersFailedCount(),TestExecutionSummary.getTotalFailureCount()
-
printTo
public void printTo(java.io.PrintWriter writer)
Description copied from interface:TestExecutionSummaryPrint this summary to the suppliedPrintWriter.This method does not print failure messages.
- Specified by:
printToin interfaceTestExecutionSummary- See Also:
TestExecutionSummary.printFailuresTo(PrintWriter)
-
printFailuresTo
public void printFailuresTo(java.io.PrintWriter writer)
Description copied from interface:TestExecutionSummaryPrint failed containers and tests, including sources and exception messages, to the suppliedPrintWriter.- Specified by:
printFailuresToin interfaceTestExecutionSummary- Parameters:
writer- thePrintWriterto 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:TestExecutionSummaryPrint 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
maxStackTraceLinesargument.By default, this method delegates to
TestExecutionSummary.printFailuresTo(PrintWriter), effectively ignoring themaxStackTraceLinesargument. Concrete implementations of this interface should therefore override this default method in order to honor themaxStackTraceLinesargument.- Specified by:
printFailuresToin interfaceTestExecutionSummary- Parameters:
writer- thePrintWriterto which to print; nevernullmaxStackTraceLines- 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:TestExecutionSummaryGet an immutable list of the failures of the test plan execution.- Specified by:
getFailuresin 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)
-
-