Skip to content

Commit 10015d9

Browse files
Document how TestExecutionListener are called (#3092)
Resolves #3061.
1 parent e68580d commit 10015d9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

documentation/src/docs/asciidoc/user-guide/advanced-topics/launcher-api.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ There is no return value for the `execute()` method, but you can use a
7171
`{SummaryGeneratingListener}`, `{LegacyXmlReportGeneratingListener}`, and
7272
`{UniqueIdTrackingListener}`.
7373

74+
NOTE: All `TestExecutionListener` methods are called sequentially. Methods for start
75+
events are called in registration order while methods for finish events are called in
76+
reverse order.
77+
Test case execution won't start before all `executionStarted` calls have returned.
78+
7479
[[launcher-api-engines-custom]]
7580
==== Registering a TestEngine
7681

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
* Concrete implementations may therefore override one or more of these methods
2626
* to be notified of the selected events.
2727
*
28+
* <p>All {@code TestExecutionListener} methods are called sequentially. Methods
29+
* for start events are called in registration order while methods for finish
30+
* events are called in reverse order. Test case execution won't start before
31+
* all {@link #executionStarted(TestIdentifier)} calls have returned.
32+
*
2833
* <p>JUnit provides two example implementations.
2934
*
3035
* <ul>

0 commit comments

Comments
 (0)