Skip to content

Commit fd00840

Browse files
committed
Note in TEL: before/after test exec. callbacks don't work w/ JUnit 4 rules
Issue: SPR-4365
1 parent 3fa88c2 commit fd00840

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
* test execution events published by the {@link TestContextManager} with which
2222
* the listener is registered.
2323
*
24+
* <p>Note that not all testing frameworks support all lifecycle callbacks defined
25+
* in this API. For example, {@link #beforeTestExecution} and
26+
* {@link #afterTestExecution} are not supported in conjunction with JUnit 4 when
27+
* using the {@link org.springframework.test.context.junit4.rules.SpringMethodRule
28+
* SpringMethodRule}.
29+
*
2430
* <p>This interface provides empty {@code default} implementations for all methods.
2531
* Concrete implementations can therefore choose to override only those methods
2632
* suitable for the task at hand.
@@ -65,8 +71,6 @@ public interface TestExecutionListener {
6571
* the class.
6672
* <p>This method should be called immediately before framework-specific
6773
* <em>before class</em> lifecycle callbacks.
68-
* <p>If a given testing framework does not support <em>before class</em>
69-
* lifecycle callbacks, this method will not be called for that framework.
7074
* <p>The default implementation is <em>empty</em>. Can be overridden by
7175
* concrete classes as necessary.
7276
* @param testContext the test context for the test; never {@code null}
@@ -186,8 +190,6 @@ default void afterTestMethod(TestContext testContext) throws Exception {
186190
* the class.
187191
* <p>This method should be called immediately after framework-specific
188192
* <em>after class</em> lifecycle callbacks.
189-
* <p>If a given testing framework does not support <em>after class</em>
190-
* lifecycle callbacks, this method will not be called for that framework.
191193
* <p>The default implementation is <em>empty</em>. Can be overridden by
192194
* concrete classes as necessary.
193195
* @param testContext the test context for the test; never {@code null}

0 commit comments

Comments
 (0)