Skip to content

Commit d8794a1

Browse files
committed
Test against EhCache 3.0 M2 (as a JCache provider)
Includes latest dependency updates (Jackson 2.6.1, Jetty 9.3.2, Undertow 1.2.10) Issue: SPR-13342
1 parent bec3b0f commit d8794a1

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ configure(allprojects) { project ->
3131
ext.eclipselinkVersion = "2.4.2"
3232
ext.ehcacheVersion = "2.10.0"
3333
ext.ehcachejcacheVersion = "1.0.1"
34+
ext.ehcache3Version = "3.0.0.m2"
3435
ext.ejbApiVersion = "3.0"
3536
ext.fileuploadVersion = "1.3.1"
3637
ext.freemarkerVersion = "2.3.23"
@@ -45,13 +46,13 @@ configure(allprojects) { project ->
4546
ext.hsqldbVersion = "2.3.3"
4647
ext.httpclientVersion = "4.5"
4748
ext.httpasyncVersion = "4.1"
48-
ext.jackson2Version = "2.6.0"
49+
ext.jackson2Version = "2.6.1"
4950
ext.jsonassertVersion = "1.2.3"
5051
ext.jsonpathVersion = "2.0.0"
5152
ext.htmlunitVersion = "2.18"
5253
ext.jasperreportsVersion = "6.1.0"
5354
ext.javamailVersion = "1.5.4"
54-
ext.jettyVersion = "9.3.1.v20150714"
55+
ext.jettyVersion = "9.3.2.v20150730"
5556
ext.jodaVersion = "2.8.1"
5657
ext.jrubyVersion = "1.7.21" // JRuby 9.0.0.0 only supported through JSR-223 (StandardScriptFactory)
5758
ext.jtaVersion = "1.2"
@@ -71,7 +72,7 @@ configure(allprojects) { project ->
7172
ext.tiles3Version = "3.0.5"
7273
ext.tomcatVersion = "8.0.24"
7374
ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support
74-
ext.undertowVersion = "1.2.9.Final"
75+
ext.undertowVersion = "1.2.10.Final"
7576
ext.woodstoxVersion = "5.0.1"
7677
ext.xmlunitVersion = "1.6"
7778
ext.xstreamVersion = "1.4.8"
@@ -666,8 +667,7 @@ project("spring-context-support") {
666667
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
667668
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
668669
testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
669-
testCompile("org.ehcache:jcache:${ehcachejcacheVersion}")
670-
// testCompile("org.ehcache:ehcache:3.0.0.m1") // alternative to ehcache-jcache above
670+
testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
671671
}
672672
}
673673

@@ -1038,6 +1038,8 @@ project("spring-test") {
10381038
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
10391039
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
10401040
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1041+
testCompile("javax.cache:cache-api:1.0.0")
1042+
testRuntime("org.ehcache:ehcache:${ehcache3Version}")
10411043
}
10421044

10431045
task testNG(type: Test) {

spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ protected ConfigurableApplicationContext getApplicationContext() {
5555

5656
@After
5757
public void shutdown() {
58-
jCacheManager.close();
58+
if (jCacheManager != null) {
59+
jCacheManager.close();
60+
}
5961
}
6062

6163

spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,9 +50,13 @@ public abstract class AbstractAnnotationTests {
5050

5151
protected CacheManager cm;
5252

53-
/** @return a refreshed application context */
53+
54+
/**
55+
* @return a refreshed application context
56+
*/
5457
protected abstract ConfigurableApplicationContext getApplicationContext();
5558

59+
5660
@Before
5761
public void setup() {
5862
ctx = getApplicationContext();
@@ -68,9 +72,12 @@ public void setup() {
6872

6973
@After
7074
public void tearDown() {
71-
ctx.close();
75+
if (ctx != null) {
76+
ctx.close();
77+
}
7278
}
7379

80+
7481
public void testCacheable(CacheableService<?> service) throws Exception {
7582
Object o1 = new Object();
7683

@@ -731,4 +738,5 @@ public void testMultiConditionalCacheAndEvict() {
731738
public void testClassMultiConditionalCacheAndEvict() {
732739
testMultiConditionalCacheAndEvict(ccs);
733740
}
741+
734742
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2002-2015 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cache.jcache;
18+
19+
/**
20+
* Just here to be run against EHCache 3, whereas the original JCacheEhCacheTests
21+
* runs against EhCache 2.x with the EhCache-JCache add-on.
22+
*
23+
* @author Juergen Hoeller
24+
*/
25+
public class JCacheEhCache3Tests extends JCacheEhCacheTests {
26+
27+
}

0 commit comments

Comments
 (0)