/* * Copyright 2015-2017 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which * accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v10.html */ package org.junit.platform.launcher.listeners; import static org.junit.platform.commons.meta.API.Usage.Experimental; import java.io.PrintWriter; import java.util.List; import org.junit.platform.commons.meta.API; import org.junit.platform.launcher.TestIdentifier; /** * Summary of test plan execution. * * @since 1.0 * @see SummaryGeneratingListener */ @API(Experimental) public interface TestExecutionSummary { /** * Get the timestamp (in milliseconds) when the test plan started. */ long getTimeStarted(); /** * Get the timestamp (in milliseconds) when the test plan finished. */ long getTimeFinished(); /** * Get the total number of {@linkplain #getContainersFailedCount failed * containers} and {@linkplain #getTestsFailedCount failed tests}. * * @see #getTestsFailedCount() * @see #getContainersFailedCount() */ long getTotalFailureCount(); /** * Get the number of containers found. */ long getContainersFoundCount(); /** * Get the number of containers started. */ long getContainersStartedCount(); /** * Get the number of containers skipped. */ long getContainersSkippedCount(); /** * Get the number of containers aborted. */ long getContainersAbortedCount(); /** * Get the number of containers that succeeded. */ long getContainersSucceededCount(); /** * Get the number of containers that failed. * * @see #getTestsFailedCount() * @see #getTotalFailureCount() */ long getContainersFailedCount(); /** * Get the number of tests found. */ long getTestsFoundCount(); /** * Get the number of tests started. */ long getTestsStartedCount(); /** * Get the number of tests skipped. */ long getTestsSkippedCount(); /** * Get the number of tests aborted. */ long getTestsAbortedCount(); /** * Get the number of tests that succeeded. */ long getTestsSucceededCount(); /** * Get the number of tests that failed. * * @see #getContainersFailedCount() * @see #getTotalFailureCount() */ long getTestsFailedCount(); /** * Print this summary to the supplied {@link PrintWriter}. * * <p>This method does not print failure messages. * * @see #printFailuresTo(PrintWriter) */ void printTo(PrintWriter writer); /** * Print failed containers and tests, including sources and exception * messages, to the supplied {@link PrintWriter}. * * @see #printTo(PrintWriter) */ void printFailuresTo(PrintWriter writer); /** * Get an immutable list of the failures of the test plan execution. */ List<Failure> getFailures(); /** * Failure of a test or container. */ interface Failure { /** * Get the identifier of the failed test or container. * * @return the {@link TestIdentifier} for this failure; never {@code null} */ TestIdentifier getTestIdentifier(); /** * Get the {@link Throwable} causing the failure. * * @return the {@link Throwable} for this failure; never {@code null} */ Throwable getException(); } }