in junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java [239:267]
private void printStackTrace(PrintWriter writer, StackTraceElement[] parentTrace, Throwable throwable,
String caption, String indentation, Set<Throwable> seenThrowables, int max) {
if (seenThrowables.contains(throwable)) {
writer.printf("%s%s[%s%s]%n", indentation, TAB, CIRCULAR, throwable);
return;
}
seenThrowables.add(throwable);
StackTraceElement[] trace = throwable.getStackTrace();
if (parentTrace != null && parentTrace.length > 0) {
writer.printf("%s%s%s%n", indentation, caption, throwable);
}
int duplicates = numberOfCommonFrames(trace, parentTrace);
int numDistinctFrames = trace.length - duplicates;
int numDisplayLines = (numDistinctFrames > max) ? max : numDistinctFrames;
for (int i = 0; i < numDisplayLines; i++) {
writer.printf("%s%s%s%n", indentation, TAB, trace[i]);
}
if (trace.length > max || duplicates != 0) {
writer.printf("%s%s%s%n", indentation, TAB, "[...]");
}
for (Throwable suppressed : throwable.getSuppressed()) {
printStackTrace(writer, trace, suppressed, SUPPRESSED, indentation + TAB, seenThrowables, max);
}
if (throwable.getCause() != null) {
printStackTrace(writer, trace, throwable.getCause(), CAUSED_BY, indentation, seenThrowables, max);
}
}