Skip to content

Commit f7c0795

Browse files
committed
Add TestGroup.CUSTOM_COMPILATION
Previously building with JDK > 1.8 b88 caused test failures due to errors with custom compilers like Jibx and Jasper reports. This commit adds a new TestGroup named CUSTOM_COMPILATION that allows the CI server to continue to run these tests but allow committers to ignore these tests.
1 parent 4da7e30 commit f7c0795

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

spring-core/src/test/java/org/springframework/tests/TestGroup.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ public enum TestGroup {
5959
/**
6060
* Tests that should only be run on the continuous integration server.
6161
*/
62-
CI;
62+
CI,
6363

64+
/**
65+
* Tests that require custom compilation beyond that of the standard JDK. This helps to
66+
* allow running tests that will otherwise fail when using JDK > 1.8 b88. See
67+
* <a href="https://jira.springsource.org/browse/SPR-10558">SPR-10558</a>
68+
*/
69+
CUSTOM_COMPILATION;
6470

6571
/**
6672
* Parse the specified comma separates string of groups.

spring-core/src/test/java/org/springframework/tests/TestGroupTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void parseMissing() throws Exception {
6464
thrown.expect(IllegalArgumentException.class);
6565
thrown.expectMessage("Unable to find test group 'missing' when parsing " +
6666
"testGroups value: 'performance, missing'. Available groups include: " +
67-
"[LONG_RUNNING,PERFORMANCE,JMXMP,CI]");
67+
"[LONG_RUNNING,PERFORMANCE,JMXMP,CI,CUSTOM_COMPILATION]");
6868
TestGroup.parse("performance, missing");
6969
}
7070

spring-oxm/src/test/java/org/springframework/oxm/jibx/JibxMarshallerTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
import javax.xml.transform.stream.StreamResult;
2121

2222
import org.custommonkey.xmlunit.XMLUnit;
23-
import org.junit.Ignore;
23+
import org.junit.BeforeClass;
2424
import org.junit.Test;
2525

2626
import org.springframework.oxm.AbstractMarshallerTests;
2727
import org.springframework.oxm.Marshaller;
28+
import org.springframework.tests.Assume;
29+
import org.springframework.tests.TestGroup;
2830

2931
import static org.custommonkey.xmlunit.XMLAssert.*;
3032
import static org.junit.Assert.assertFalse;
@@ -36,9 +38,13 @@
3638
* NOTE: These tests fail under Eclipse/IDEA because JiBX binding does
3739
* not occur by default. The Gradle build should succeed, however.
3840
*/
39-
@Ignore("INCOMPATIBLE WITH OPENJDK 8 b89+")
4041
public class JibxMarshallerTests extends AbstractMarshallerTests {
4142

43+
@BeforeClass
44+
public static void compilerAssumptions() {
45+
Assume.group(TestGroup.CUSTOM_COMPILATION);
46+
}
47+
4248
@Override
4349
protected Marshaller createMarshaller() throws Exception {
4450
JibxMarshaller marshaller = new JibxMarshaller();

spring-oxm/src/test/java/org/springframework/oxm/jibx/JibxUnmarshallerTests.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020

2121
import javax.xml.transform.stream.StreamSource;
2222

23+
import org.junit.BeforeClass;
2324
import org.junit.Ignore;
2425
import org.junit.Test;
2526
import org.springframework.oxm.AbstractUnmarshallerTests;
2627
import org.springframework.oxm.Unmarshaller;
28+
import org.springframework.tests.Assume;
29+
import org.springframework.tests.TestGroup;
2730

2831
import static org.junit.Assert.*;
2932

@@ -33,13 +36,17 @@
3336
* NOTE: These tests fail under Eclipse/IDEA because JiBX binding does
3437
* not occur by default. The Gradle build should succeed, however.
3538
*/
36-
@Ignore("INCOMPATIBLE WITH OPENJDK 8 b89+")
3739
public class JibxUnmarshallerTests extends AbstractUnmarshallerTests {
3840

3941
protected static final String INPUT_STRING_WITH_SPECIAL_CHARACTERS =
4042
"<tns:flights xmlns:tns=\"http://samples.springframework.org/flight\">" +
4143
"<tns:flight><tns:airline>Air Libert\u00e9</tns:airline><tns:number>42</tns:number></tns:flight></tns:flights>";
4244

45+
@BeforeClass
46+
public static void compilerAssumptions() {
47+
Assume.group(TestGroup.CUSTOM_COMPILATION);
48+
}
49+
4350
@Override
4451
protected Unmarshaller createUnmarshaller() throws Exception {
4552
JibxMarshaller unmarshaller = new JibxMarshaller();

spring-webmvc/src/test/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.springframework.mock.web.test.MockHttpServletRequest;
3030
import org.springframework.mock.web.test.MockHttpServletResponse;
3131
import org.springframework.tests.Assume;
32+
import org.springframework.tests.TestGroup;
3233
import org.springframework.ui.jasperreports.PersonBean;
3334
import org.springframework.ui.jasperreports.ProductBean;
3435
import org.springframework.util.ClassUtils;
@@ -59,6 +60,7 @@ public abstract class AbstractJasperReportsTests {
5960
@BeforeClass
6061
public static void assumptions() {
6162
Assume.canLoadNativeDirFonts();
63+
Assume.group(TestGroup.CUSTOM_COMPILATION);
6264
}
6365

6466
@Before

0 commit comments

Comments
 (0)