diff --git a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java index 6f75cc068e..2c20095aee 100644 --- a/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java @@ -55,20 +55,25 @@ import org.springframework.util.ResourceUtils; * {@linkplain java.lang.reflect.Method test method}, depending on the configured * value of the {@link Sql#executionPhase executionPhase} flag. * - *

Scripts will be executed either within an existing Spring-managed transaction - * or within an isolated transaction, depending on the configured value of - * {@link SqlConfig#transactionMode}. + *

Scripts will be executed without a transaction, within an existing + * Spring-managed transaction, or within an isolated transaction, depending + * on the configured value of {@link SqlConfig#transactionMode} and the + * presence of a transaction manager. * *

Script Resources

*

For details on default script detection and how explicit script locations * are interpreted, see {@link Sql#scripts}. * *

Required Spring Beans

- *

A {@link DataSource} and {@link PlatformTransactionManager} must be defined - * as beans in the Spring {@link ApplicationContext} for the corresponding test. - * Consult the javadocs for {@link TestContextTransactionUtils#retrieveDataSource} - * and {@link TestContextTransactionUtils#retrieveTransactionManager} for details - * on the algorithms used to locate these beans. + *

A {@link PlatformTransactionManager} and a {@link DataSource}, + * just a {@link PlatformTransactionManager}, or just a {@link DataSource} + * must be defined as beans in the Spring {@link ApplicationContext} for the + * corresponding test. Consult the javadocs for {@link SqlConfig#transactionMode}, + * {@link SqlConfig#transactionManager}, {@link SqlConfig#dataSource}, + * {@link TestContextTransactionUtils#retrieveDataSource}, and + * {@link TestContextTransactionUtils#retrieveTransactionManager} for details + * on permissible configuration constellations and on the algorithms used to + * locate these beans. * * @author Sam Brannen * @since 4.1