Skip to content

Commit 47e1724

Browse files
committed
Deprecate TxConfigAttributes alongside @TxConfig
Since @TransactionConfiguration is now deprecated, this commit also deprecates TransactionConfigurationAttributes with the intention of completely removing TransactionConfigurationAttributes once @TransactionConfiguration has been removed. Issue: SPR-13277
1 parent d6bdfca commit 47e1724

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spring-test/src/main/java/org/springframework/test/context/transaction/TransactionConfigurationAttributes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
* @author Juergen Hoeller
2828
* @since 2.5
2929
* @see TransactionConfiguration
30+
* @deprecated As of Spring Framework 4.2, this class is officially deprecated
31+
* and will be removed when {@code @TransactionConfiguration} is removed.
3032
*/
33+
@Deprecated
3134
public class TransactionConfigurationAttributes {
3235

3336
private final String transactionManagerName;

spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ public class TransactionalTestExecutionListener extends AbstractTestExecutionLis
130130

131131
private static final Log logger = LogFactory.getLog(TransactionalTestExecutionListener.class);
132132

133+
@SuppressWarnings("deprecation")
133134
private static final TransactionConfigurationAttributes defaultTxConfigAttributes = new TransactionConfigurationAttributes();
134135

135136
protected final TransactionAttributeSource attributeSource = new AnnotationTransactionAttributeSource();
136137

138+
@SuppressWarnings("deprecation")
137139
private TransactionConfigurationAttributes configurationAttributes;
138140

139141

@@ -343,6 +345,7 @@ protected PlatformTransactionManager getTransactionManager(TestContext testConte
343345
* @see #getTransactionManager(TestContext, String)
344346
*/
345347
protected PlatformTransactionManager getTransactionManager(TestContext testContext) {
348+
@SuppressWarnings("deprecation")
346349
String tmName = retrieveConfigurationAttributes(testContext).getTransactionManagerName();
347350
return TestContextTransactionUtils.retrieveTransactionManager(testContext, tmName);
348351
}
@@ -358,6 +361,7 @@ protected PlatformTransactionManager getTransactionManager(TestContext testConte
358361
* @return the <em>default rollback</em> flag for the supplied test context
359362
* @throws Exception if an error occurs while determining the default rollback flag
360363
*/
364+
@SuppressWarnings("deprecation")
361365
protected final boolean isDefaultRollback(TestContext testContext) throws Exception {
362366
Class<?> testClass = testContext.getTestClass();
363367
Rollback rollback = findAnnotation(testClass, Rollback.class);

0 commit comments

Comments
 (0)