diff --git a/build.gradle b/build.gradle index 6d5a58be586..743cc8508f1 100644 --- a/build.gradle +++ b/build.gradle @@ -31,6 +31,7 @@ configure(allprojects) { project -> ext.eclipselinkVersion = "2.4.2" ext.ehcacheVersion = "2.10.0" ext.ehcachejcacheVersion = "1.0.1" + ext.ehcache3Version = "3.0.0.m2" ext.ejbApiVersion = "3.0" ext.fileuploadVersion = "1.3.1" ext.freemarkerVersion = "2.3.23" @@ -45,13 +46,13 @@ configure(allprojects) { project -> ext.hsqldbVersion = "2.3.3" ext.httpclientVersion = "4.5" ext.httpasyncVersion = "4.1" - ext.jackson2Version = "2.6.0" + ext.jackson2Version = "2.6.1" ext.jsonassertVersion = "1.2.3" ext.jsonpathVersion = "2.0.0" ext.htmlunitVersion = "2.18" ext.jasperreportsVersion = "6.1.0" ext.javamailVersion = "1.5.4" - ext.jettyVersion = "9.3.1.v20150714" + ext.jettyVersion = "9.3.2.v20150730" ext.jodaVersion = "2.8.1" ext.jrubyVersion = "1.7.21" // JRuby 9.0.0.0 only supported through JSR-223 (StandardScriptFactory) ext.jtaVersion = "1.2" @@ -71,7 +72,7 @@ configure(allprojects) { project -> ext.tiles3Version = "3.0.5" ext.tomcatVersion = "8.0.24" ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support - ext.undertowVersion = "1.2.9.Final" + ext.undertowVersion = "1.2.10.Final" ext.woodstoxVersion = "5.0.1" ext.xmlunitVersion = "1.6" ext.xstreamVersion = "1.4.8" @@ -666,8 +667,7 @@ project("spring-context-support") { testCompile("org.hsqldb:hsqldb:${hsqldbVersion}") testCompile("org.slf4j:slf4j-api:${slf4jVersion}") testRuntime("com.sun.mail:javax.mail:${javamailVersion}") - testCompile("org.ehcache:jcache:${ehcachejcacheVersion}") - // testCompile("org.ehcache:ehcache:3.0.0.m1") // alternative to ehcache-jcache above + testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}") } } @@ -1038,6 +1038,8 @@ project("spring-test") { testCompile("org.hsqldb:hsqldb:${hsqldbVersion}") testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}") testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") + testCompile("javax.cache:cache-api:1.0.0") + testRuntime("org.ehcache:ehcache:${ehcache3Version}") } task testNG(type: Test) { diff --git a/spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java b/spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java index 9879b2c4771..03f9927828a 100644 --- a/spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java +++ b/spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java @@ -55,7 +55,9 @@ public class JCacheEhCacheTests extends AbstractAnnotationTests { @After public void shutdown() { - jCacheManager.close(); + if (jCacheManager != null) { + jCacheManager.close(); + } } diff --git a/spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java b/spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java index f074347af15..5ee37593b50 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,9 +50,13 @@ public abstract class AbstractAnnotationTests { protected CacheManager cm; - /** @return a refreshed application context */ + + /** + * @return a refreshed application context + */ protected abstract ConfigurableApplicationContext getApplicationContext(); + @Before public void setup() { ctx = getApplicationContext(); @@ -68,9 +72,12 @@ public abstract class AbstractAnnotationTests { @After public void tearDown() { - ctx.close(); + if (ctx != null) { + ctx.close(); + } } + public void testCacheable(CacheableService service) throws Exception { Object o1 = new Object(); @@ -731,4 +738,5 @@ public abstract class AbstractAnnotationTests { public void testClassMultiConditionalCacheAndEvict() { testMultiConditionalCacheAndEvict(ccs); } + } diff --git a/spring-test/src/test/java/org/springframework/cache/jcache/JCacheEhCache3Tests.java b/spring-test/src/test/java/org/springframework/cache/jcache/JCacheEhCache3Tests.java new file mode 100644 index 00000000000..6d54f9a797c --- /dev/null +++ b/spring-test/src/test/java/org/springframework/cache/jcache/JCacheEhCache3Tests.java @@ -0,0 +1,27 @@ +/* + * Copyright 2002-2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cache.jcache; + +/** + * Just here to be run against EHCache 3, whereas the original JCacheEhCacheTests + * runs against EhCache 2.x with the EhCache-JCache add-on. + * + * @author Juergen Hoeller + */ +public class JCacheEhCache3Tests extends JCacheEhCacheTests { + +}