Browse Source

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
pull/853/merge
Juergen Hoeller 10 years ago
parent
commit
d8794a1edc
  1. 12
      build.gradle
  2. 4
      spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java
  3. 14
      spring-context/src/test/java/org/springframework/cache/config/AbstractAnnotationTests.java
  4. 27
      spring-test/src/test/java/org/springframework/cache/jcache/JCacheEhCache3Tests.java

12
build.gradle

@ -31,6 +31,7 @@ configure(allprojects) { project -> @@ -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 -> @@ -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 -> @@ -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") { @@ -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") { @@ -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) {

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

@ -55,7 +55,9 @@ public class JCacheEhCacheTests extends AbstractAnnotationTests { @@ -55,7 +55,9 @@ public class JCacheEhCacheTests extends AbstractAnnotationTests {
@After
public void shutdown() {
jCacheManager.close();
if (jCacheManager != null) {
jCacheManager.close();
}
}

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

@ -1,5 +1,5 @@ @@ -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 { @@ -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 { @@ -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 { @@ -731,4 +738,5 @@ public abstract class AbstractAnnotationTests {
public void testClassMultiConditionalCacheAndEvict() {
testMultiConditionalCacheAndEvict(ccs);
}
}

27
spring-test/src/test/java/org/springframework/cache/jcache/JCacheEhCache3Tests.java vendored

@ -0,0 +1,27 @@ @@ -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 {
}
Loading…
Cancel
Save