From 657b145ea2b325005ca58376ce4af9dbeaf3e69f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 28 Mar 2011 14:43:01 +0000 Subject: [PATCH] [SPR-8030] AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests are now officially deprecated. --- .../FailingBeforeAndAfterMethodsTests.java | 23 +++++++++---------- ...ProfileValueJUnit38SpringContextTests.java | 3 ++- .../RepeatedJUnit38SpringContextTests.java | 7 +++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java index 4e298bc8d0..86add46761 100644 --- a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java +++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java @@ -28,7 +28,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; - import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestContext; import org.springframework.test.context.TestExecutionListener; @@ -47,7 +46,7 @@ import org.springframework.test.context.transaction.BeforeTransaction; * href="http://opensource.atlassian.com/projects/spring/browse/SPR-3960" * target="_blank">SPR-3960. *

- * + * * @author Sam Brannen * @since 2.5 */ @@ -83,9 +82,9 @@ public class FailingBeforeAndAfterMethodsTests { testCase.setName(testName); TestResult testResult = testCase.run(); assertEquals("Verifying number of errors for test method [" + testName + "] and class [" + this.clazz + "].", - 0, testResult.errorCount()); + 0, testResult.errorCount()); assertEquals("Verifying number of failures for test method [" + testName + "] and class [" + this.clazz + "].", - 1, testResult.failureCount()); + 1, testResult.failureCount()); } @@ -97,7 +96,6 @@ public class FailingBeforeAndAfterMethodsTests { } } - static class AlwaysFailingAfterTestMethodTestExecutionListener extends AbstractTestExecutionListener { @Override @@ -106,24 +104,24 @@ public class FailingBeforeAndAfterMethodsTests { } } - - @TestExecutionListeners(value = { AlwaysFailingBeforeTestMethodTestExecutionListener.class }, inheritListeners = false) + @SuppressWarnings("deprecation") + @TestExecutionListeners(listeners = AlwaysFailingBeforeTestMethodTestExecutionListener.class, inheritListeners = false) public static class AlwaysFailingBeforeTestMethodTestCase extends AbstractJUnit38SpringContextTests { public void testNothing() { } } - - @TestExecutionListeners(value = { AlwaysFailingAfterTestMethodTestExecutionListener.class }, inheritListeners = false) + @SuppressWarnings("deprecation") + @TestExecutionListeners(listeners = AlwaysFailingAfterTestMethodTestExecutionListener.class, inheritListeners = false) public static class AlwaysFailingAfterTestMethodTestCase extends AbstractJUnit38SpringContextTests { public void testNothing() { } } - - @ContextConfiguration(locations = { "FailingBeforeAndAfterMethodsTests-context.xml" }) + @SuppressWarnings("deprecation") + @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingBeforeTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests { public void testNothing() { @@ -135,7 +133,8 @@ public class FailingBeforeAndAfterMethodsTests { } } - @ContextConfiguration(locations = { "FailingBeforeAndAfterMethodsTests-context.xml" }) + @SuppressWarnings("deprecation") + @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingAfterTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests { public void testNothing() { diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java index 92b6322ea3..1b8e6e6a00 100644 --- a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java +++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/ProfileValueJUnit38SpringContextTests.java @@ -137,7 +137,8 @@ public class ProfileValueJUnit38SpringContextTests extends TestCase { * explicitly configured with an empty list, thus disabling all default * listeners. */ - @TestExecutionListeners(value = {}, inheritListeners = false) + @SuppressWarnings("deprecation") + @TestExecutionListeners(listeners = {}, inheritListeners = false) public static class DefaultProfileValueSourceTestCase extends AbstractJUnit38SpringContextTests { int invocationCount = 0; diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/RepeatedJUnit38SpringContextTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/RepeatedJUnit38SpringContextTests.java index c39c50383a..c6848b3258 100644 --- a/org.springframework.test/src/test/java/org/springframework/test/context/junit38/RepeatedJUnit38SpringContextTests.java +++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit38/RepeatedJUnit38SpringContextTests.java @@ -24,7 +24,7 @@ import org.springframework.test.context.TestExecutionListeners; /** * Unit test for {@link AbstractJUnit38SpringContextTests} which focuses on * proper support of the {@link Repeat @Repeat} annotation. - * + * * @author Sam Brannen * @since 2.5 */ @@ -42,7 +42,7 @@ public class RepeatedJUnit38SpringContextTests extends TestCase { final RepeatedTestCase repeatedTestCase = new RepeatedTestCase(testName); repeatedTestCase.run(); assertEquals("Verifying number of invocations for test method [" + testName + "].", expectedNumInvocations, - repeatedTestCase.invocationCount); + repeatedTestCase.invocationCount); } public void testRepeatAnnotationSupport() throws Exception { @@ -58,7 +58,8 @@ public class RepeatedJUnit38SpringContextTests extends TestCase { * explicitly configured with an empty list, thus disabling all default * listeners. */ - @TestExecutionListeners(value = {}, inheritListeners = false) + @SuppressWarnings("deprecation") + @TestExecutionListeners(listeners = {}, inheritListeners = false) protected static class RepeatedTestCase extends AbstractJUnit38SpringContextTests { int invocationCount = 0;