diff --git a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java index c2c71537006831f3a9127e0bd67a3b08501697f9..7c0b64426efbc13d280227c117b78dbfc17eb639 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestExecutionListener.java @@ -21,6 +21,12 @@ package org.springframework.test.context; * test execution events published by the {@link TestContextManager} with which * the listener is registered. * + *

Note that not all testing frameworks support all lifecycle callbacks defined + * in this API. For example, {@link #beforeTestExecution} and + * {@link #afterTestExecution} are not supported in conjunction with JUnit 4 when + * using the {@link org.springframework.test.context.junit4.rules.SpringMethodRule + * SpringMethodRule}. + * *

This interface provides empty {@code default} implementations for all methods. * Concrete implementations can therefore choose to override only those methods * suitable for the task at hand. @@ -65,8 +71,6 @@ public interface TestExecutionListener { * the class. *

This method should be called immediately before framework-specific * before class lifecycle callbacks. - *

If a given testing framework does not support before class - * lifecycle callbacks, this method will not be called for that framework. *

The default implementation is empty. Can be overridden by * concrete classes as necessary. * @param testContext the test context for the test; never {@code null} @@ -186,8 +190,6 @@ public interface TestExecutionListener { * the class. *

This method should be called immediately after framework-specific * after class lifecycle callbacks. - *

If a given testing framework does not support after class - * lifecycle callbacks, this method will not be called for that framework. *

The default implementation is empty. Can be overridden by * concrete classes as necessary. * @param testContext the test context for the test; never {@code null}