Skip to content

Commit 3fac3e9

Browse files
committed
Document that TestExecutionListeners cannot fail test execution
Resolves #3591.
1 parent eb20f80 commit 3fac3e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static org.apiguardian.api.API.Status.STABLE;
1414

1515
import org.apiguardian.api.API;
16+
import org.junit.platform.commons.util.UnrecoverableExceptions;
1617
import org.junit.platform.engine.TestExecutionResult;
1718
import org.junit.platform.engine.TestExecutionResult.Status;
1819
import org.junit.platform.engine.reporting.ReportEntry;
@@ -30,6 +31,12 @@
3031
* events are called in reverse order. Test case execution won't start before
3132
* all {@link #executionStarted(TestIdentifier)} calls have returned.
3233
*
34+
* <p>If an exception is thrown by an implementation of a method of this
35+
* interface, the exception will be caught and logged unless it is deemed
36+
* {@linkplain UnrecoverableExceptions unrecoverable}. In consequence, a
37+
* {@code TestExecutionListener} cannot cause test execution to fail or abort it
38+
* early by throwing an exception.
39+
*
3340
* <p>JUnit provides two example implementations.
3441
*
3542
* <ul>

0 commit comments

Comments
 (0)