Compatibility with EhCache 3.0 M1 (as a JCache provider)

Issue: SPR-12847
This commit is contained in:
Juergen Hoeller
2015-03-24 19:20:26 +01:00
parent 09027f7972
commit 26d4f91835
3 changed files with 13 additions and 8 deletions

View File

@@ -1,7 +1,12 @@
/**
* Support classes for the open source cache
* <a href="http://ehcache.sourceforge.net">EhCache</a>,
* <a href="http://ehcache.sourceforge.net">EhCache 2.x</a>,
* allowing to set up an EhCache CacheManager and Caches
* as beans in a Spring context.
*
* <p>Note: EhCache 3.x lives in a different package namespace
* and is not covered by the traditional support classes here.
* Instead, consider using it through JCache (JSR-107), with
* Spring's support in {@link org.springframework.cache.jcache}.
*/
package org.springframework.cache.ehcache;

View File

@@ -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.
@@ -20,7 +20,6 @@ import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.cache.configuration.MutableConfiguration;
import org.ehcache.jcache.JCacheConfiguration;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
@@ -82,9 +81,9 @@ public class JCacheEhCacheTests extends AbstractAnnotationTests {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
MutableConfiguration<Object, Object> mutableConfiguration = new MutableConfiguration<Object, Object>();
mutableConfiguration.setStoreByValue(false); // otherwise value has to be Serializable
cacheManager.createCache("testCache", new JCacheConfiguration<Object, Object>(mutableConfiguration));
cacheManager.createCache("primary", new JCacheConfiguration<Object, Object>(mutableConfiguration));
cacheManager.createCache("secondary", new JCacheConfiguration<Object, Object>(mutableConfiguration));
cacheManager.createCache("testCache", mutableConfiguration);
cacheManager.createCache("primary", mutableConfiguration);
cacheManager.createCache("secondary", mutableConfiguration);
return cacheManager;
}