Generated by
JDiff

org.springframework.test.context.transaction Documentation Differences

This file contains all the changes in documentation in the package org.springframework.test.context.transaction as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class TransactionConfiguration

{@code TransactionConfiguration} defines class-level metadata for configuring transactional tests. @author Sam Brannen @since 2.5 @see ContextConfiguration TransactionalTestExecutionListener @see TransactionalTestExecutionListenerorg.springframework.test.context.ContextConfiguration

Class TransactionalTestExecutionListener

{@code TestExecutionListener} that provides support for executing executing teststests within transactions by usinghonoring the @Transactional and @NotTransactional annotations. Expects a PlatformTransactionManager bean to be defined in the Spring ApplicationContext for the test.

Changes to the database during a test that is run with @{@code @Transactional} will be be run within a transaction that will, by default, be automatically rolled back after completion of the test; whereas, changes to the database during a test that is run with @{@code @NotTransactional} willwill not be run within a transaction. Test methods that are notnot annotated with either {@code @@Transactional} (at the class or method level) or @NotTransactional will notnot be run within a transaction.

Transactional commit and rollback behavior can be configured via the class-level @@TransactionConfiguration and method-level @@Rollback annotations. @TransactionConfiguration

In case alsothere provides are multiple configurationinstances of {@code PlatformTransactionManager} within the test's {@code ApplicationContext}, {@code @TransactionConfiguration} supports configuring the bean name of the PlatformTransactionManager{@code that PlatformTransactionManager} is tothat should be used to drive transactions. Alternatively, TransactionManagementConfigurer can be implemented in an @Configuration class.

When executing transactional tests, it is sometimes useful to be able to execute to execute certain set up or tear down code outside of a transaction. {@code TransactionalTestExecutionListener} provides such support for methods annotated with @@BeforeTransaction and @@AfterTransaction. @author Sam Brannen @author Juergen Hoeller @since 2.5 @see TransactionConfiguration @see TransactionManagementConfigurer @see org.springframework.transaction.annotation.Transactional @see org.springframework.test.annotation.NotTransactional @see org.springframework.test.annotation.Rollback @see BeforeTransaction @see AfterTransaction

Class TransactionalTestExecutionListener, void afterTestMethod(TestContext)

If a transaction is currently active for the test method of the supplied test context, this method will end the transaction and run @AfterTransaction methods.

@{@code @AfterTransaction} methods are guaranteed to be invoked even if an error occurs while ending the transaction.

Class TransactionalTestExecutionListener, void beforeTestMethod(TestContext)

If the test method of the supplied test context is configured to run within a transaction, this method will run @BeforeTransaction methods and start a new transaction.

Note that if a @{@code @BeforeTransaction} method fails, remainingany @remaining {@code @BeforeTransaction} methods will not not be invoked, and a transactiontransaction will not be started. @see org.springframework.transaction.annotation.Transactional @see org.springframework.test.annotation.NotTransactionalNotTransactional @see #getTransactionManager(TestContext, String)

Class TransactionalTestExecutionListener, PlatformTransactionManager getTransactionManager(TestContext)

Get the transaction manager to use for the supplied test context. @param testContext the test context for which the transaction manager should be retrieved @return the transaction manager to use, or null if not found @throws BeansException if an error occurs while retrieving the transaction managermanager @see #getTransactionManager(TestContext, String)