diff --git a/build-spring-framework/resources/changelog.txt b/build-spring-framework/resources/changelog.txt index 5f4769a4065..e072b24bb90 100644 --- a/build-spring-framework/resources/changelog.txt +++ b/build-spring-framework/resources/changelog.txt @@ -3,15 +3,16 @@ SPRING FRAMEWORK CHANGELOG http://www.springsource.org -Changes in version 3.0.0.RC1 (2009 Q3) --------------------------------------- +Changes in version 3.0.0.RC1 (2009-09-XX) +----------------------------------------- * upgraded to JUnit 4.7 and TestNG 5.10 -* SpringJUnit4ClassRunner is now compatible with JUnit 4.5 - 4.7 +* SpringJUnit4ClassRunner is now compatible with JUnit 4.5, 4.6, and 4.7 +* @NotTransactional is now deprecated Changes in version 3.0.0.M4 (2009-08-10) ------------------------------------------ +---------------------------------------- * upgraded to JUnit 4.6, TestNG 5.9, and EasyMock 2.5.1 * updated all Spring Framework OSGI manifests to list unversioned imports explicitly diff --git a/org.springframework.test/src/main/java/org/springframework/test/annotation/NotTransactional.java b/org.springframework.test/src/main/java/org/springframework/test/annotation/NotTransactional.java index b32c44d32ed..ade7b71fb71 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/annotation/NotTransactional.java +++ b/org.springframework.test/src/main/java/org/springframework/test/annotation/NotTransactional.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,21 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Test annotation to indicate that a method is not transactional. + * Test annotation to indicate that a method is not transactional. * * @author Rod Johnson * @author Sam Brannen * @since 2.0 + * @deprecated as of Spring 3.0, in favor of moving the non-transactional test + * method to a separate (non-transactional) test class or to a + * {@link org.springframework.test.context.transaction.BeforeTransaction + * @BeforeTransaction} or + * {@link org.springframework.test.context.transaction.AfterTransaction + * @AfterTransaction} method. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) +@Deprecated public @interface NotTransactional { } diff --git a/spring-framework-reference/src/testing.xml b/spring-framework-reference/src/testing.xml index 9eba3228a57..d7433204396 100644 --- a/spring-framework-reference/src/testing.xml +++ b/spring-framework-reference/src/testing.xml @@ -181,7 +181,7 @@ use, thus allowing instrumentation of tests in various environments including JUnit, TestNG, etc. - + Legacy JUnit 3.8 class hierarchy is deprecated As of Spring 3.0, the legacy JUnit 3.8 base class hierarchy @@ -192,7 +192,7 @@ Thus any code which depends on the legacy JUnit 3.8 support should be migrated to the Spring TestContext Framework. - +
@@ -613,6 +613,23 @@ public void afterTransaction() { public void testProcessWithoutTransaction() { // ... } + + + @NotTransactional is deprecated + As of Spring 3.0, @NotTransactional + is deprecated in favor of moving the + non-transactional test + method to a separate (non-transactional) test class or to a + @BeforeTransaction or + @AfterTransaction method. + As an alternative to annotating an entire class with + @Transactional consider + annotating individual methods with + @Transactional; + doing so allows a mix of transactional and non-transactional + methods in the same test class without the need for + using @NotTransactional. + @@ -1318,14 +1335,9 @@ public final class HibernateTitleDaoTests { in the annotation support section. - There are several options for configuring transactions for - individual test methods. If transactions are not enabled for the + If transactions are not enabled for the entire test class, methods may be explicitly annotated with - @Transactional. Similarly, if - transactions are enabled for the entire test - class, methods may be explicitly flagged not to run within a - transaction by annotating them with - @NotTransactional. To control whether + @Transactional. To control whether or not a transaction should commit for a particular test method, you may use the @Rollback annotation to override the class-level default rollback setting. @@ -1364,7 +1376,9 @@ public final class HibernateTitleDaoTests { @BeforeTransaction or @AfterTransaction will naturally not be executed for tests annotated with - @NotTransactional. + @NotTransactional. Note, however, + that @NotTransactional is + deprecated as of Spring 3.0. The following JUnit 4 based example displays a fictitious @@ -1407,11 +1421,6 @@ public class FictitiousTransactionalTest { // logic to verify the final state after transaction has rolled back } - @Test - @NotTransactional - public void performNonDatabaseRelatedAction() { - // logic which does not modify database state - } }