From 025d111efc7975aadeb65a805c0d2ae4525b980a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 5 Dec 2012 10:31:31 +0100 Subject: [PATCH] Re-enable and document @Ignore'd tests Documented why static nested test cases in the spring-test module are ignored, explaining that such "TestCase classes are run manually by the enclosing test class". Prior to the migration to Gradle (i.e., with Spring Build), these tests would not have been picked up by the test suite since they end with a "TestCase" suffix instead of "Test" or "Tests". Re-enabled HibernateMultiEntityManagerFactoryIntegrationTests. For the remaining tests that were disabled as a result of the migration to Gradle, comments have been added to the @Ignore declarations. Issue: SPR-8116, SPR-9398 --- .../security/CallbacksSecurityTests.java | 4 +++- ...tiEntityManagerFactoryIntegrationTests.java | 1 - ...toryWithAspectJWeavingIntegrationTests.java | 5 ++++- ...tiEntityManagerFactoryIntegrationTests.java | 5 ++++- .../FailingBeforeAndAfterMethodsTests.java | 11 ++++++----- .../ExpectedExceptionSpringRunnerTests.java | 5 +++-- .../FailingBeforeAndAfterMethodsTests.java | 18 +++++++++--------- .../junit4/RepeatedSpringRunnerTests.java | 8 ++++---- .../context/junit4/TimedSpringRunnerTests.java | 8 ++++---- .../test/context/testng/SPR-8116.txt | 3 --- .../test/context/testng/SPR-9398.txt | 3 +++ .../remoting/jaxws/JaxWsSupportTests.java | 9 ++++++--- 12 files changed, 46 insertions(+), 34 deletions(-) delete mode 100644 spring-test/src/test/java/org/springframework/test/context/testng/SPR-8116.txt create mode 100644 spring-test/src/test/java/org/springframework/test/context/testng/SPR-9398.txt diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java index 048bc025ac..33b4e83c99 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java @@ -436,7 +436,9 @@ public class CallbacksSecurityTests { } @Test - @Ignore // TODO SPR-8116 passes under Eclipse, but fails under Gradle with https://gist.github.com/1664133 + @Ignore("passes under Eclipse, but fails under Gradle with https://gist.github.com/1664133") + // TODO SPR-8116 passes under Eclipse, but fails under Gradle with + // https://gist.github.com/1664133 public void testContainerPrivileges() throws Exception { AccessControlContext acc = provider.getAccessControlContext(); diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/hibernate/HibernateMultiEntityManagerFactoryIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/hibernate/HibernateMultiEntityManagerFactoryIntegrationTests.java index a2a64855d4..65147c04d1 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/hibernate/HibernateMultiEntityManagerFactoryIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/hibernate/HibernateMultiEntityManagerFactoryIntegrationTests.java @@ -26,7 +26,6 @@ import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrat * * @author Juergen Hoeller */ -@org.junit.Ignore // TODO SPR-8116 work out JPA 1 vs 2 classpath issues in spring-orm public class HibernateMultiEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests { diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/openjpa/OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/openjpa/OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests.java index c3f9c2cf1d..94936ddf00 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/openjpa/OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/openjpa/OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests.java @@ -16,17 +16,20 @@ package org.springframework.orm.jpa.openjpa; +import org.junit.Ignore; + /** * Test that AspectJ weaving (in particular the currently shipped aspects) work with JPA (see SPR-3873 for more details). * * @author Ramnivas Laddad */ -@org.junit.Ignore // TODO SPR-8116 this test causes gradle to hang. +// TODO SPR-8116 this test causes gradle to hang. // when run independently e.g. `./gradlew :spring-orm:test -Dtest.single=OpenJpaEntity...` // it works fine. When run together with all other tests e.g. `./gradlew :spring-orm:test` // it hangs on the 'testCanSerializeProxies' test method. Note that this test DOES pass in // Eclipse, even when the entire 'spring-orm' module is run. Run gradle with '-i' to // get more details when reproducing the hanging test. +@Ignore("this test causes gradle to hang") public class OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests extends OpenJpaEntityManagerFactoryIntegrationTests { protected String[] getConfigLocations() { diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/toplink/TopLinkMultiEntityManagerFactoryIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/toplink/TopLinkMultiEntityManagerFactoryIntegrationTests.java index 618004188c..5b75b444c8 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/toplink/TopLinkMultiEntityManagerFactoryIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/toplink/TopLinkMultiEntityManagerFactoryIntegrationTests.java @@ -19,6 +19,7 @@ package org.springframework.orm.jpa.toplink; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; +import org.junit.Ignore; import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrationTests; /** @@ -26,13 +27,15 @@ import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrat * * @author Costin Leau */ -@org.junit.Ignore // TODO SPR-8116 this test causes gradle to hang. See OJEMFWAJWIT. +// TODO SPR-8116 this test causes gradle to hang. See OJEMFWAJWIT. +@Ignore("this test causes gradle to hang. See OJEMFWAJWIT.") public class TopLinkMultiEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests { private EntityManagerFactory entityManagerFactory2; + @SuppressWarnings("deprecation") public TopLinkMultiEntityManagerFactoryIntegrationTests() { setAutowireMode(AUTOWIRE_BY_NAME); } diff --git a/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java index 9b00448014..319fee93c8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java @@ -16,7 +16,7 @@ package org.springframework.test.context.junit38; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; @@ -24,6 +24,7 @@ import java.util.Collection; import junit.framework.TestCase; import junit.framework.TestResult; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -104,7 +105,7 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @SuppressWarnings("deprecation") @TestExecutionListeners(listeners = AlwaysFailingBeforeTestMethodTestExecutionListener.class, inheritListeners = false) public static class AlwaysFailingBeforeTestMethodTestCase extends AbstractJUnit38SpringContextTests { @@ -113,7 +114,7 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @SuppressWarnings("deprecation") @TestExecutionListeners(listeners = AlwaysFailingAfterTestMethodTestExecutionListener.class, inheritListeners = false) public static class AlwaysFailingAfterTestMethodTestCase extends AbstractJUnit38SpringContextTests { @@ -122,7 +123,7 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @SuppressWarnings("deprecation") @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingBeforeTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests { @@ -136,7 +137,7 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @SuppressWarnings("deprecation") @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingAfterTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/ExpectedExceptionSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/ExpectedExceptionSpringRunnerTests.java index f0e343a36d..cedbc19121 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/ExpectedExceptionSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/ExpectedExceptionSpringRunnerTests.java @@ -16,10 +16,11 @@ package org.springframework.test.context.junit4; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import java.util.ArrayList; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; @@ -59,7 +60,7 @@ public class ExpectedExceptionSpringRunnerTests { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners({}) public static final class ExpectedExceptionSpringRunnerTestCase { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java index b91122d4af..4bdf5837e3 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java @@ -16,12 +16,12 @@ package org.springframework.test.context.junit4; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; @@ -146,32 +146,32 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestClassTestExecutionListener.class) public static class AlwaysFailingBeforeTestClassTestCase extends BaseTestCase { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestClassTestExecutionListener.class) public static class AlwaysFailingAfterTestClassTestCase extends BaseTestCase { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingPrepareTestInstanceTestExecutionListener.class) public static class AlwaysFailingPrepareTestInstanceTestCase extends BaseTestCase { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class) public static class AlwaysFailingBeforeTestMethodTestCase extends BaseTestCase { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestMethodTestExecutionListener.class) public static class AlwaysFailingAfterTestMethodTestCase extends BaseTestCase { } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingBeforeTransactionTestCase extends AbstractTransactionalJUnit4SpringContextTests { @@ -185,7 +185,7 @@ public class FailingBeforeAndAfterMethodsTests { } } - @org.junit.Ignore // TODO SPR-8116 + @Ignore("TestCase classes are run manually by the enclosing test class") @ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml") public static class FailingAfterTransactionTestCase extends AbstractTransactionalJUnit4SpringContextTests { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java index 149a000a4f..5b02643ea6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java @@ -16,13 +16,14 @@ package org.springframework.test.context.junit4; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; @@ -100,7 +101,7 @@ public class RepeatedSpringRunnerTests { @RunWith(SpringJUnit4ClassRunner.class) - @TestExecutionListeners( {}) + @TestExecutionListeners({}) public abstract static class AbstractRepeatedTestCase { protected void incrementInvocationCount() throws IOException { @@ -151,8 +152,7 @@ public class RepeatedSpringRunnerTests { * href="http://jira.springframework.org/browse/SPR-6011" * target="_blank">SPR-6011. */ - @org.junit.Ignore // TODO SPR-8116 causing timeouts on cbeams' (otherwise fast) MBP. - // Timeouts are 2x-4x their expected range. Something seems wrong indeed. + @Ignore("TestCase classes are run manually by the enclosing test class") public static final class TimedRepeatedTestCase extends AbstractRepeatedTestCase { @Test diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java index 1d8a94f30e..4d7eb155da 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java @@ -16,8 +16,9 @@ package org.springframework.test.context.junit4; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; @@ -56,10 +57,9 @@ public class TimedSpringRunnerTests { } - @org.junit.Ignore // TODO SPR-8116 causing timeouts on cbeams' (otherwise fast) MBP. - // Timeouts are 2x-5x their expected range. Something seems wrong indeed. + @Ignore("TestCase classes are run manually by the enclosing test class") @RunWith(SpringJUnit4ClassRunner.class) - @TestExecutionListeners( {}) + @TestExecutionListeners({}) public static final class TimedSpringRunnerTestCase { // Should Pass. diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/SPR-8116.txt b/spring-test/src/test/java/org/springframework/test/context/testng/SPR-8116.txt deleted file mode 100644 index 5e22d2f564..0000000000 --- a/spring-test/src/test/java/org/springframework/test/context/testng/SPR-8116.txt +++ /dev/null @@ -1,3 +0,0 @@ -TODO SPR-8116 re-enable TestNG support for spring-test - -These TestNG test classes are currently not run at all. diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/SPR-9398.txt b/spring-test/src/test/java/org/springframework/test/context/testng/SPR-9398.txt new file mode 100644 index 0000000000..dfbdc9ad83 --- /dev/null +++ b/spring-test/src/test/java/org/springframework/test/context/testng/SPR-9398.txt @@ -0,0 +1,3 @@ +TODO [SPR-9398] re-enable TestNG support for spring-test. + +These TestNG test classes are currently not run at all. diff --git a/spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java b/spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java index ce55225328..3c68c850af 100644 --- a/spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java +++ b/spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java @@ -16,8 +16,11 @@ package org.springframework.remoting.jaxws; +import static org.junit.Assert.*; + import java.net.MalformedURLException; import java.net.URL; + import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider; import javax.xml.ws.Service; @@ -25,9 +28,8 @@ import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceRef; import javax.xml.ws.soap.AddressingFeature; -import static org.junit.Assert.*; +import org.junit.Ignore; import org.junit.Test; - import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition; @@ -38,7 +40,8 @@ import org.springframework.context.support.GenericApplicationContext; * @author Juergen Hoeller * @since 2.5 */ -@org.junit.Ignore // TODO SPR-8116 - see https://gist.github.com/1150858 +// TODO SPR-8116 - see https://gist.github.com/1150858 +@Ignore("see https://gist.github.com/1150858") public class JaxWsSupportTests { @Test