Skip to content

Commit 025d111

Browse files
committed
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
1 parent d12fbcc commit 025d111

12 files changed

Lines changed: 46 additions & 34 deletions

File tree

spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,9 @@ public void testConstructor() throws Exception {
436436
}
437437

438438
@Test
439-
@Ignore // TODO SPR-8116 passes under Eclipse, but fails under Gradle with https://gist.github.com/1664133
439+
@Ignore("passes under Eclipse, but fails under Gradle with https://gist.github.com/1664133")
440+
// TODO SPR-8116 passes under Eclipse, but fails under Gradle with
441+
// https://gist.github.com/1664133
440442
public void testContainerPrivileges() throws Exception {
441443
AccessControlContext acc = provider.getAccessControlContext();
442444

spring-orm/src/test/java/org/springframework/orm/jpa/hibernate/HibernateMultiEntityManagerFactoryIntegrationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*
2727
* @author Juergen Hoeller
2828
*/
29-
@org.junit.Ignore // TODO SPR-8116 work out JPA 1 vs 2 classpath issues in spring-orm
3029
public class HibernateMultiEntityManagerFactoryIntegrationTests extends
3130
AbstractContainerEntityManagerFactoryIntegrationTests {
3231

spring-orm/src/test/java/org/springframework/orm/jpa/openjpa/OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@
1616

1717
package org.springframework.orm.jpa.openjpa;
1818

19+
import org.junit.Ignore;
20+
1921
/**
2022
* Test that AspectJ weaving (in particular the currently shipped aspects) work with JPA (see SPR-3873 for more details).
2123
*
2224
* @author Ramnivas Laddad
2325
*/
24-
@org.junit.Ignore // TODO SPR-8116 this test causes gradle to hang.
26+
// TODO SPR-8116 this test causes gradle to hang.
2527
// when run independently e.g. `./gradlew :spring-orm:test -Dtest.single=OpenJpaEntity...`
2628
// it works fine. When run together with all other tests e.g. `./gradlew :spring-orm:test`
2729
// it hangs on the 'testCanSerializeProxies' test method. Note that this test DOES pass in
2830
// Eclipse, even when the entire 'spring-orm' module is run. Run gradle with '-i' to
2931
// get more details when reproducing the hanging test.
32+
@Ignore("this test causes gradle to hang")
3033
public class OpenJpaEntityManagerFactoryWithAspectJWeavingIntegrationTests extends OpenJpaEntityManagerFactoryIntegrationTests {
3134

3235
protected String[] getConfigLocations() {

spring-orm/src/test/java/org/springframework/orm/jpa/toplink/TopLinkMultiEntityManagerFactoryIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,23 @@
1919
import javax.persistence.EntityManager;
2020
import javax.persistence.EntityManagerFactory;
2121

22+
import org.junit.Ignore;
2223
import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrationTests;
2324

2425
/**
2526
* Toplink-specific JPA tests with multiple EntityManagerFactory instances.
2627
*
2728
* @author Costin Leau
2829
*/
29-
@org.junit.Ignore // TODO SPR-8116 this test causes gradle to hang. See OJEMFWAJWIT.
30+
// TODO SPR-8116 this test causes gradle to hang. See OJEMFWAJWIT.
31+
@Ignore("this test causes gradle to hang. See OJEMFWAJWIT.")
3032
public class TopLinkMultiEntityManagerFactoryIntegrationTests extends
3133
AbstractContainerEntityManagerFactoryIntegrationTests {
3234

3335
private EntityManagerFactory entityManagerFactory2;
3436

3537

38+
@SuppressWarnings("deprecation")
3639
public TopLinkMultiEntityManagerFactoryIntegrationTests() {
3740
setAutowireMode(AUTOWIRE_BY_NAME);
3841
}

spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
package org.springframework.test.context.junit38;
1818

19-
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.*;
2020

2121
import java.util.Arrays;
2222
import java.util.Collection;
2323

2424
import junit.framework.TestCase;
2525
import junit.framework.TestResult;
2626

27+
import org.junit.Ignore;
2728
import org.junit.Test;
2829
import org.junit.runner.RunWith;
2930
import org.junit.runners.Parameterized;
@@ -104,7 +105,7 @@ public void afterTestMethod(TestContext testContext) {
104105
}
105106
}
106107

107-
@org.junit.Ignore // TODO SPR-8116
108+
@Ignore("TestCase classes are run manually by the enclosing test class")
108109
@SuppressWarnings("deprecation")
109110
@TestExecutionListeners(listeners = AlwaysFailingBeforeTestMethodTestExecutionListener.class, inheritListeners = false)
110111
public static class AlwaysFailingBeforeTestMethodTestCase extends AbstractJUnit38SpringContextTests {
@@ -113,7 +114,7 @@ public void testNothing() {
113114
}
114115
}
115116

116-
@org.junit.Ignore // TODO SPR-8116
117+
@Ignore("TestCase classes are run manually by the enclosing test class")
117118
@SuppressWarnings("deprecation")
118119
@TestExecutionListeners(listeners = AlwaysFailingAfterTestMethodTestExecutionListener.class, inheritListeners = false)
119120
public static class AlwaysFailingAfterTestMethodTestCase extends AbstractJUnit38SpringContextTests {
@@ -122,7 +123,7 @@ public void testNothing() {
122123
}
123124
}
124125

125-
@org.junit.Ignore // TODO SPR-8116
126+
@Ignore("TestCase classes are run manually by the enclosing test class")
126127
@SuppressWarnings("deprecation")
127128
@ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml")
128129
public static class FailingBeforeTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests {
@@ -136,7 +137,7 @@ public void beforeTransaction() {
136137
}
137138
}
138139

139-
@org.junit.Ignore // TODO SPR-8116
140+
@Ignore("TestCase classes are run manually by the enclosing test class")
140141
@SuppressWarnings("deprecation")
141142
@ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml")
142143
public static class FailingAfterTransactionalTestCase extends AbstractTransactionalJUnit38SpringContextTests {

spring-test/src/test/java/org/springframework/test/context/junit4/ExpectedExceptionSpringRunnerTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
package org.springframework.test.context.junit4;
1818

19-
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.*;
2020

2121
import java.util.ArrayList;
2222

23+
import org.junit.Ignore;
2324
import org.junit.Test;
2425
import org.junit.runner.RunWith;
2526
import org.junit.runner.notification.RunNotifier;
@@ -59,7 +60,7 @@ public void expectedExceptions() throws Exception {
5960
}
6061

6162

62-
@org.junit.Ignore // TODO SPR-8116
63+
@Ignore("TestCase classes are run manually by the enclosing test class")
6364
@RunWith(SpringJUnit4ClassRunner.class)
6465
@TestExecutionListeners({})
6566
public static final class ExpectedExceptionSpringRunnerTestCase {

spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
package org.springframework.test.context.junit4;
1818

19-
import static org.junit.Assert.assertEquals;
20-
import static org.junit.Assert.fail;
19+
import static org.junit.Assert.*;
2120

2221
import java.util.Arrays;
2322
import java.util.Collection;
2423

24+
import org.junit.Ignore;
2525
import org.junit.Test;
2626
import org.junit.runner.RunWith;
2727
import org.junit.runner.notification.RunNotifier;
@@ -146,32 +146,32 @@ public void testNothing() {
146146
}
147147
}
148148

149-
@org.junit.Ignore // TODO SPR-8116
149+
@Ignore("TestCase classes are run manually by the enclosing test class")
150150
@TestExecutionListeners(AlwaysFailingBeforeTestClassTestExecutionListener.class)
151151
public static class AlwaysFailingBeforeTestClassTestCase extends BaseTestCase {
152152
}
153153

154-
@org.junit.Ignore // TODO SPR-8116
154+
@Ignore("TestCase classes are run manually by the enclosing test class")
155155
@TestExecutionListeners(AlwaysFailingAfterTestClassTestExecutionListener.class)
156156
public static class AlwaysFailingAfterTestClassTestCase extends BaseTestCase {
157157
}
158158

159-
@org.junit.Ignore // TODO SPR-8116
159+
@Ignore("TestCase classes are run manually by the enclosing test class")
160160
@TestExecutionListeners(AlwaysFailingPrepareTestInstanceTestExecutionListener.class)
161161
public static class AlwaysFailingPrepareTestInstanceTestCase extends BaseTestCase {
162162
}
163163

164-
@org.junit.Ignore // TODO SPR-8116
164+
@Ignore("TestCase classes are run manually by the enclosing test class")
165165
@TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class)
166166
public static class AlwaysFailingBeforeTestMethodTestCase extends BaseTestCase {
167167
}
168168

169-
@org.junit.Ignore // TODO SPR-8116
169+
@Ignore("TestCase classes are run manually by the enclosing test class")
170170
@TestExecutionListeners(AlwaysFailingAfterTestMethodTestExecutionListener.class)
171171
public static class AlwaysFailingAfterTestMethodTestCase extends BaseTestCase {
172172
}
173173

174-
@org.junit.Ignore // TODO SPR-8116
174+
@Ignore("TestCase classes are run manually by the enclosing test class")
175175
@ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml")
176176
public static class FailingBeforeTransactionTestCase extends AbstractTransactionalJUnit4SpringContextTests {
177177

@@ -185,7 +185,7 @@ public void beforeTransaction() {
185185
}
186186
}
187187

188-
@org.junit.Ignore // TODO SPR-8116
188+
@Ignore("TestCase classes are run manually by the enclosing test class")
189189
@ContextConfiguration("FailingBeforeAndAfterMethodsTests-context.xml")
190190
public static class FailingAfterTransactionTestCase extends AbstractTransactionalJUnit4SpringContextTests {
191191

spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616

1717
package org.springframework.test.context.junit4;
1818

19-
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.*;
2020

2121
import java.io.IOException;
2222
import java.util.Arrays;
2323
import java.util.Collection;
2424
import java.util.concurrent.atomic.AtomicInteger;
2525

26+
import org.junit.Ignore;
2627
import org.junit.Test;
2728
import org.junit.runner.RunWith;
2829
import org.junit.runner.notification.RunNotifier;
@@ -100,7 +101,7 @@ public void assertRepetitions() throws Exception {
100101

101102

102103
@RunWith(SpringJUnit4ClassRunner.class)
103-
@TestExecutionListeners( {})
104+
@TestExecutionListeners({})
104105
public abstract static class AbstractRepeatedTestCase {
105106

106107
protected void incrementInvocationCount() throws IOException {
@@ -151,8 +152,7 @@ public void repeatedFiveTimes() throws Exception {
151152
* href="http://jira.springframework.org/browse/SPR-6011"
152153
* target="_blank">SPR-6011</a>.
153154
*/
154-
@org.junit.Ignore // TODO SPR-8116 causing timeouts on cbeams' (otherwise fast) MBP.
155-
// Timeouts are 2x-4x their expected range. Something seems wrong indeed.
155+
@Ignore("TestCase classes are run manually by the enclosing test class")
156156
public static final class TimedRepeatedTestCase extends AbstractRepeatedTestCase {
157157

158158
@Test

spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
package org.springframework.test.context.junit4;
1818

19-
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.*;
2020

21+
import org.junit.Ignore;
2122
import org.junit.Test;
2223
import org.junit.runner.RunWith;
2324
import org.junit.runner.notification.RunNotifier;
@@ -56,10 +57,9 @@ public void timedTests() throws Exception {
5657
}
5758

5859

59-
@org.junit.Ignore // TODO SPR-8116 causing timeouts on cbeams' (otherwise fast) MBP.
60-
// Timeouts are 2x-5x their expected range. Something seems wrong indeed.
60+
@Ignore("TestCase classes are run manually by the enclosing test class")
6161
@RunWith(SpringJUnit4ClassRunner.class)
62-
@TestExecutionListeners( {})
62+
@TestExecutionListeners({})
6363
public static final class TimedSpringRunnerTestCase {
6464

6565
// Should Pass.

spring-test/src/test/java/org/springframework/test/context/testng/SPR-8116.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)