Browse Source

Renamed JCacheEhCacheTest to JCacheEhCacheTests

pull/595/head
Juergen Hoeller 11 years ago
parent
commit
a53987ace1
  1. 25
      spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java

25
spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTest.java → spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheTests.java vendored

@ -40,13 +40,13 @@ import org.springframework.context.annotation.Bean; @@ -40,13 +40,13 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
*
* @author Stephane Nicoll
*/
public class JCacheEhCacheTest extends AbstractAnnotationTests {
public class JCacheEhCacheTests extends AbstractAnnotationTests {
private CacheManager jCacheManager;
@Override
protected ConfigurableApplicationContext getApplicationContext() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EnableCachingConfig.class);
@ -59,12 +59,14 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests { @@ -59,12 +59,14 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests {
jCacheManager.close();
}
@Override
@Test
@Ignore("Multi cache manager support to be added")
public void testCustomCacheManager() {
}
@Configuration
@EnableCaching
static class EnableCachingConfig extends CachingConfigurerSupport {
@ -78,16 +80,11 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests { @@ -78,16 +80,11 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests {
@Bean
public CacheManager jCacheManager() {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
final 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));
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));
return cacheManager;
}
@ -111,6 +108,6 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests { @@ -111,6 +108,6 @@ public class JCacheEhCacheTest extends AbstractAnnotationTests {
public KeyGenerator customKeyGenerator() {
return new SomeCustomKeyGenerator();
}
}
}
}
Loading…
Cancel
Save