Skip to content

Commit

Permalink
Document concurrency for TestExecutionListener implementations
Browse files Browse the repository at this point in the history
Add a note about concurrency considerations for
`TestExecutionListener` implementations to this interface's Javadoc.

Issue: #2539
Co-authored-by: Marc Philipp <mail@marcphilipp.de>
  • Loading branch information
2 people authored and sormuras committed Oct 10, 2022
1 parent 43acc46 commit 4a87980
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
* {@link #testPlanExecutionStarted(TestPlan)} and
* {@link #testPlanExecutionFinished(TestPlan)}.
*
* <p>Note on concurrency: {@link #testPlanExecutionStarted(TestPlan)} and
* {@link #testPlanExecutionFinished(TestPlan)} are always called from the same
* thread. It is safe to assume that there is at most one {@code TestPlan}
* instance at a time. All other methods could be called from different threads
* concurrently in case one or multiple test engines execute tests in parallel.
*
* @since 1.0
* @see Launcher
* @see TestPlan
Expand All @@ -58,6 +64,8 @@ public interface TestExecutionListener {
* Called when the execution of the {@link TestPlan} has started,
* <em>before</em> any test has been executed.
*
* <p>Called from the same thread as {@link #testPlanExecutionFinished(TestPlan)}.
*
* @param testPlan describes the tree of tests about to be executed
*/
default void testPlanExecutionStarted(TestPlan testPlan) {
Expand All @@ -67,6 +75,8 @@ default void testPlanExecutionStarted(TestPlan testPlan) {
* Called when the execution of the {@link TestPlan} has finished,
* <em>after</em> all tests have been executed.
*
* <p>Called from the same thread as {@link #testPlanExecutionStarted(TestPlan)}.
*
* @param testPlan describes the tree of tests that have been executed
*/
default void testPlanExecutionFinished(TestPlan testPlan) {
Expand Down

0 comments on commit 4a87980

Please sign in to comment.