From 35226695ebe004fca77cbe5844f113a5adeb0962 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 16 Jul 2014 17:22:24 +0200 Subject: [PATCH] Rename default to testCache in Cache related tests This simply renames the default cache from "default" to "testCache" as this might be a reserved names for third party cache providers. --- .../AnnotatedClassCacheableService.java | 34 +++++++------- .../cache/config/DefaultCacheableService.java | 44 +++++++++---------- .../cache/config/annotation-cache-aspectj.xml | 4 +- .../cache/config/AbstractAnnotationTests.java | 25 +++++------ .../AnnotatedClassCacheableService.java | 36 +++++++-------- .../cache/config/CustomInterceptorTests.java | 2 +- .../cache/config/DefaultCacheableService.java | 44 +++++++++---------- .../config/EnableCachingIntegrationTests.java | 6 +-- .../cache/config/EnableCachingTests.java | 4 +- .../cache/config/SomeCustomKeyGenerator.java | 2 +- .../config/annotationDrivenCacheConfig.xml | 4 +- ...nDrivenCacheNamespace-manager-resolver.xml | 2 +- ...nnotationDrivenCacheNamespace-resolver.xml | 2 +- .../config/annotationDrivenCacheNamespace.xml | 4 +- .../cache/config/cache-advice-invalid.xml | 2 +- .../cache/config/cache-advice.xml | 38 ++++++++-------- 16 files changed, 126 insertions(+), 127 deletions(-) diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java b/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java index 592786a551..a4afb1bdf5 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java @@ -27,7 +27,7 @@ import org.springframework.cache.annotation.Caching; * @author Costin Leau * @author Phillip Webb */ -@Cacheable("default") +@Cacheable("testCache") public class AnnotatedClassCacheableService implements CacheableService { private final AtomicLong counter = new AtomicLong(); @@ -49,94 +49,94 @@ public class AnnotatedClassCacheableService implements CacheableService } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void invalidate(Object arg1) { } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } @Override - @CacheEvict(value = "default", allEntries = true) + @CacheEvict(value = "testCache", allEntries = true) public void evictAll(Object arg1) { } @Override - @CacheEvict(value = "default", beforeInvocation = true) + @CacheEvict(value = "testCache", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @CacheEvict(value = "default", key = "#p0") + @CacheEvict(value = "testCache", key = "#p0") public void evict(Object arg1, Object arg2) { } @Override - @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) + @CacheEvict(value = "testCache", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @Cacheable(value = "default", key = "#p0") + @Cacheable(value = "testCache", key = "#p0") public Object key(Object arg1, Object arg2) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default") + @Cacheable(value = "testCache") public Object varArgsKey(Object... args) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.caches[0].name") + @Cacheable(value = "testCache", key = "#root.methodName + #root.caches[0].name") public Object name(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") + @Cacheable(value = "testCache", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Object rootVars(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "customKyeGenerator") + @Cacheable(value = "testCache", keyGenerator = "customKyeGenerator") public Object customKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "unknownBeanName") + @Cacheable(value = "testCache", keyGenerator = "unknownBeanName") public Object unknownCustomKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "customCacheManager") + @Cacheable(value = "testCache", cacheManager = "customCacheManager") public Object customCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "unknownBeanName") + @Cacheable(value = "testCache", cacheManager = "unknownBeanName") public Object unknownCustomCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut("default") + @CachePut("testCache") public Object update(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut(value = "default", condition = "#arg.equals(3)") + @CachePut(value = "testCache", condition = "#arg.equals(3)") public Object conditionalUpdate(Object arg) { return arg; } diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java b/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java index 9cce821e8b..1b2fc20941 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java +++ b/spring-aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java @@ -35,118 +35,118 @@ public class DefaultCacheableService implements CacheableService { private final AtomicLong nullInvocations = new AtomicLong(); @Override - @Cacheable("default") + @Cacheable("testCache") public Long cache(Object arg1) { return counter.getAndIncrement(); } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void invalidate(Object arg1) { } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } @Override - @CacheEvict(value = "default", allEntries = true) + @CacheEvict(value = "testCache", allEntries = true) public void evictAll(Object arg1) { } @Override - @CacheEvict(value = "default", beforeInvocation = true) + @CacheEvict(value = "testCache", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @CacheEvict(value = "default", key = "#p0") + @CacheEvict(value = "testCache", key = "#p0") public void evict(Object arg1, Object arg2) { } @Override - @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) + @CacheEvict(value = "testCache", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @Cacheable(value = "default", condition = "#classField == 3") + @Cacheable(value = "testCache", condition = "#classField == 3") public Long conditional(int classField) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", unless = "#result > 10") + @Cacheable(value = "testCache", unless = "#result > 10") public Long unless(int arg) { return (long) arg; } @Override - @Cacheable(value = "default", key = "#p0") + @Cacheable(value = "testCache", key = "#p0") public Long key(Object arg1, Object arg2) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default") + @Cacheable(value = "testCache") public Long varArgsKey(Object... args) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName") + @Cacheable(value = "testCache", key = "#root.methodName") public Long name(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") + @Cacheable(value = "testCache", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Long rootVars(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "customKeyGenerator") + @Cacheable(value = "testCache", keyGenerator = "customKeyGenerator") public Long customKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "unknownBeanName") + @Cacheable(value = "testCache", keyGenerator = "unknownBeanName") public Long unknownCustomKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "customCacheManager") + @Cacheable(value = "testCache", cacheManager = "customCacheManager") public Long customCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "unknownBeanName") + @Cacheable(value = "testCache", cacheManager = "unknownBeanName") public Long unknownCustomCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut("default") + @CachePut("testCache") public Long update(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut(value = "default", condition = "#arg.equals(3)") + @CachePut(value = "testCache", condition = "#arg.equals(3)") public Long conditionalUpdate(Object arg) { return Long.valueOf(arg.toString()); } @Override - @Cacheable("default") + @Cacheable("testCache") public Long nullValue(Object arg1) { nullInvocations.incrementAndGet(); return null; @@ -158,13 +158,13 @@ public class DefaultCacheableService implements CacheableService { } @Override - @Cacheable("default") + @Cacheable("testCache") public Long throwChecked(Object arg1) throws Exception { throw new Exception(arg1.toString()); } @Override - @Cacheable("default") + @Cacheable("testCache") public Long throwUnchecked(Object arg1) { throw new UnsupportedOperationException(arg1.toString()); } diff --git a/spring-aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml b/spring-aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml index 4d3a898b7f..b551b66656 100644 --- a/spring-aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml +++ b/spring-aspects/src/test/java/org/springframework/cache/config/annotation-cache-aspectj.xml @@ -28,7 +28,7 @@ - + @@ -46,7 +46,7 @@ - + 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 92ec015de7..76a69de0bf 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 @@ -49,8 +49,6 @@ public abstract class AbstractAnnotationTests { protected CacheManager cm; - protected CacheManager customCm; - /** @return a refreshed application context */ protected abstract ConfigurableApplicationContext getApplicationContext(); @@ -60,10 +58,9 @@ public abstract class AbstractAnnotationTests { cs = ctx.getBean("service", CacheableService.class); ccs = ctx.getBean("classService", CacheableService.class); cm = ctx.getBean("cacheManager", CacheManager.class); - customCm = ctx.getBean("customCacheManager", CacheManager.class); Collection cn = cm.getCacheNames(); - assertTrue(cn.contains("default")); + assertTrue(cn.contains("testCache")); assertTrue(cn.contains("secondary")); assertTrue(cn.contains("primary")); } @@ -179,7 +176,7 @@ public abstract class AbstractAnnotationTests { assertSame(r1, r2); assertNotSame(r1, r10); service.evictAll(new Object()); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); assertNull(cache.get(o1)); assertNull(cache.get(o2)); @@ -202,7 +199,7 @@ public abstract class AbstractAnnotationTests { } public void testUnlessExpression(CacheableService service) throws Exception { - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); cache.clear(); service.unless(10); service.unless(11); @@ -249,7 +246,7 @@ public abstract class AbstractAnnotationTests { Object key = new Object(); Object r1 = service.name(key); assertSame(r1, service.name(key)); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); // assert the method name is used assertNotNull(cache.get(keyName)); } @@ -258,7 +255,7 @@ public abstract class AbstractAnnotationTests { Object key = new Object(); Object r1 = service.rootVars(key); assertSame(r1, service.rootVars(key)); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); // assert the method name is used String expectedKey = "rootVarsrootVars" + AopProxyUtils.ultimateTargetClass(service) + service; assertNotNull(cache.get(expectedKey)); @@ -292,7 +289,7 @@ public abstract class AbstractAnnotationTests { public void testCacheUpdate(CacheableService service) { Object o = new Object(); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); assertNull(cache.get(o)); Object r1 = service.update(o); assertSame(r1, cache.get(o).get()); @@ -307,7 +304,7 @@ public abstract class AbstractAnnotationTests { Integer one = Integer.valueOf(1); Integer three = Integer.valueOf(3); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); assertEquals(one, Integer.valueOf(service.conditionalUpdate(one).toString())); assertNull(cache.get(one)); @@ -567,7 +564,7 @@ public abstract class AbstractAnnotationTests { @Test public void testClassMethodName() throws Exception { - testMethodName(ccs, "namedefault"); + testMethodName(ccs, "nametestCache"); } @Test @@ -585,7 +582,7 @@ public abstract class AbstractAnnotationTests { Object param = new Object(); Object r1 = cs.customKeyGenerator(param); assertSame(r1, cs.customKeyGenerator(param)); - Cache cache = cm.getCache("default"); + Cache cache = cm.getCache("testCache"); // Checks that the custom keyGenerator was used Object expectedKey = SomeCustomKeyGenerator.generateKey("customKeyGenerator", param); assertNotNull(cache.get(expectedKey)); @@ -604,10 +601,12 @@ public abstract class AbstractAnnotationTests { @Test public void testCustomCacheManager() { + CacheManager customCm = ctx.getBean("customCacheManager", CacheManager.class); Object key = new Object(); Object r1 = cs.customCacheManager(key); assertSame(r1, cs.customCacheManager(key)); - Cache cache = customCm.getCache("default"); + + Cache cache = customCm.getCache("testCache"); assertNotNull(cache.get(key)); } diff --git a/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java b/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java index e9456b2d6e..88c75a0e57 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java +++ b/spring-context/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java @@ -28,7 +28,7 @@ import org.springframework.cache.annotation.Caching; * @author Phillip Webb * @author Stephane Nicoll */ -@Cacheable("default") +@Cacheable("testCache") public class AnnotatedClassCacheableService implements CacheableService { private final AtomicLong counter = new AtomicLong(); @@ -46,100 +46,100 @@ public class AnnotatedClassCacheableService implements CacheableService } @Override - @Cacheable(value = "default", unless = "#result > 10") + @Cacheable(value = "testCache", unless = "#result > 10") public Object unless(int arg) { return arg; } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void invalidate(Object arg1) { } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } @Override - @CacheEvict(value = "default", allEntries = true) + @CacheEvict(value = "testCache", allEntries = true) public void evictAll(Object arg1) { } @Override - @CacheEvict(value = "default", beforeInvocation = true) + @CacheEvict(value = "testCache", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @CacheEvict(value = "default", key = "#p0") + @CacheEvict(value = "testCache", key = "#p0") public void evict(Object arg1, Object arg2) { } @Override - @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) + @CacheEvict(value = "testCache", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @Cacheable(value = "default", key = "#p0") + @Cacheable(value = "testCache", key = "#p0") public Object key(Object arg1, Object arg2) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default") + @Cacheable(value = "testCache") public Object varArgsKey(Object... args) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.caches[0].name") + @Cacheable(value = "testCache", key = "#root.methodName + #root.caches[0].name") public Object name(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") + @Cacheable(value = "testCache", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Object rootVars(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "customKyeGenerator") + @Cacheable(value = "testCache", keyGenerator = "customKyeGenerator") public Object customKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "unknownBeanName") + @Cacheable(value = "testCache", keyGenerator = "unknownBeanName") public Object unknownCustomKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "customCacheManager") + @Cacheable(value = "testCache", cacheManager = "customCacheManager") public Object customCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "unknownBeanName") + @Cacheable(value = "testCache", cacheManager = "unknownBeanName") public Object unknownCustomCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut("default") + @CachePut("testCache") public Object update(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut(value = "default", condition = "#arg.equals(3)") + @CachePut(value = "testCache", condition = "#arg.equals(3)") public Object conditionalUpdate(Object arg) { return arg; } diff --git a/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java b/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java index b3a63c0dc7..2384800bfc 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java @@ -92,7 +92,7 @@ public class CustomInterceptorTests { @Bean public CacheManager cacheManager() { - return CacheTestUtils.createSimpleCacheManager("default", "primary", "secondary"); + return CacheTestUtils.createSimpleCacheManager("testCache", "primary", "secondary"); } @Bean diff --git a/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java b/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java index 8e4ef7e042..ebeec4f550 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java +++ b/spring-context/src/test/java/org/springframework/cache/config/DefaultCacheableService.java @@ -36,118 +36,118 @@ public class DefaultCacheableService implements CacheableService { private final AtomicLong nullInvocations = new AtomicLong(); @Override - @Cacheable("default") + @Cacheable("testCache") public Long cache(Object arg1) { return counter.getAndIncrement(); } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void invalidate(Object arg1) { } @Override - @CacheEvict("default") + @CacheEvict("testCache") public void evictWithException(Object arg1) { throw new RuntimeException("exception thrown - evict should NOT occur"); } @Override - @CacheEvict(value = "default", allEntries = true) + @CacheEvict(value = "testCache", allEntries = true) public void evictAll(Object arg1) { } @Override - @CacheEvict(value = "default", beforeInvocation = true) + @CacheEvict(value = "testCache", beforeInvocation = true) public void evictEarly(Object arg1) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @CacheEvict(value = "default", key = "#p0") + @CacheEvict(value = "testCache", key = "#p0") public void evict(Object arg1, Object arg2) { } @Override - @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) + @CacheEvict(value = "testCache", key = "#p0", beforeInvocation = true) public void invalidateEarly(Object arg1, Object arg2) { throw new RuntimeException("exception thrown - evict should still occur"); } @Override - @Cacheable(value = "default", condition = "#classField == 3") + @Cacheable(value = "testCache", condition = "#classField == 3") public Long conditional(int classField) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", unless = "#result > 10") + @Cacheable(value = "testCache", unless = "#result > 10") public Long unless(int arg) { return (long) arg; } @Override - @Cacheable(value = "default", key = "#p0") + @Cacheable(value = "testCache", key = "#p0") public Long key(Object arg1, Object arg2) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default") + @Cacheable(value = "testCache") public Long varArgsKey(Object... args) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName") + @Cacheable(value = "testCache", key = "#root.methodName") public Long name(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") + @Cacheable(value = "testCache", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") public Long rootVars(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "customKeyGenerator") + @Cacheable(value = "testCache", keyGenerator = "customKeyGenerator") public Long customKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", keyGenerator = "unknownBeanName") + @Cacheable(value = "testCache", keyGenerator = "unknownBeanName") public Long unknownCustomKeyGenerator(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "customCacheManager") + @Cacheable(value = "testCache", cacheManager = "customCacheManager") public Long customCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @Cacheable(value = "default", cacheManager = "unknownBeanName") + @Cacheable(value = "testCache", cacheManager = "unknownBeanName") public Long unknownCustomCacheManager(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut("default") + @CachePut("testCache") public Long update(Object arg1) { return counter.getAndIncrement(); } @Override - @CachePut(value = "default", condition = "#arg.equals(3)") + @CachePut(value = "testCache", condition = "#arg.equals(3)") public Long conditionalUpdate(Object arg) { return Long.valueOf(arg.toString()); } @Override - @Cacheable("default") + @Cacheable("testCache") public Long nullValue(Object arg1) { nullInvocations.incrementAndGet(); return null; @@ -159,13 +159,13 @@ public class DefaultCacheableService implements CacheableService { } @Override - @Cacheable("default") + @Cacheable("testCache") public Long throwChecked(Object arg1) throws Exception { throw new Exception(arg1.toString()); } @Override - @Cacheable("default") + @Cacheable("testCache") public Long throwUnchecked(Object arg1) { throw new UnsupportedOperationException(arg1.toString()); } diff --git a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java index 9a03de6785..8cf22ba580 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java @@ -43,7 +43,7 @@ public class EnableCachingIntegrationTests { private void fooGetSimple(ApplicationContext context, FooService service) { CacheManager cacheManager = context.getBean(CacheManager.class); - Cache cache = cacheManager.getCache("default"); + Cache cache = cacheManager.getCache("testCache"); Object key = new Object(); assertCacheMiss(key, cache); @@ -57,7 +57,7 @@ public class EnableCachingIntegrationTests { @Override @Bean public CacheManager cacheManager() { - return CacheTestUtils.createSimpleCacheManager("default"); + return CacheTestUtils.createSimpleCacheManager("testCache"); } } @@ -85,7 +85,7 @@ public class EnableCachingIntegrationTests { public Object getSimple(Object key); } - @CacheConfig(cacheNames = "default") + @CacheConfig(cacheNames = "testCache") private static class FooServiceImpl implements FooService { private final AtomicLong counter = new AtomicLong(); diff --git a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java index 4846deb007..6b67b8cde1 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java @@ -149,7 +149,7 @@ public class EnableCachingTests extends AbstractAnnotationTests { @Override @Bean public CacheManager cacheManager() { - return CacheTestUtils.createSimpleCacheManager("default", "primary", "secondary"); + return CacheTestUtils.createSimpleCacheManager("testCache", "primary", "secondary"); } @Bean @@ -181,7 +181,7 @@ public class EnableCachingTests extends AbstractAnnotationTests { @Bean public CacheManager customCacheManager() { - return CacheTestUtils.createSimpleCacheManager("default"); + return CacheTestUtils.createSimpleCacheManager("testCache"); } } diff --git a/spring-context/src/test/java/org/springframework/cache/config/SomeCustomKeyGenerator.java b/spring-context/src/test/java/org/springframework/cache/config/SomeCustomKeyGenerator.java index 8a2b160ffa..4b2ec5099a 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/SomeCustomKeyGenerator.java +++ b/spring-context/src/test/java/org/springframework/cache/config/SomeCustomKeyGenerator.java @@ -26,7 +26,7 @@ import java.lang.reflect.Method; * * @author Stephane Nicoll */ -final class SomeCustomKeyGenerator implements KeyGenerator { +public final class SomeCustomKeyGenerator implements KeyGenerator { @Override public Object generate(Object target, Method method, Object... params) { diff --git a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheConfig.xml b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheConfig.xml index b1eaa40908..abb8cf73d2 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheConfig.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheConfig.xml @@ -27,7 +27,7 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml index c5eef72f1e..66f53e6b97 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml @@ -11,7 +11,7 @@ - + diff --git a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-resolver.xml b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-resolver.xml index 013111799c..6ae36d7af5 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-resolver.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace-resolver.xml @@ -13,7 +13,7 @@ + p:name="testCache"/> diff --git a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace.xml b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace.xml index 3517dae80e..98ca6bb466 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/annotationDrivenCacheNamespace.xml @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/spring-context/src/test/resources/org/springframework/cache/config/cache-advice-invalid.xml b/spring-context/src/test/resources/org/springframework/cache/config/cache-advice-invalid.xml index b156bdb3cc..b4362503b4 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/cache-advice-invalid.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/cache-advice-invalid.xml @@ -7,7 +7,7 @@ - + diff --git a/spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml b/spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml index 2a0fb51901..8b6e61ec48 100644 --- a/spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml +++ b/spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml @@ -8,7 +8,7 @@ http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd"> - + @@ -20,17 +20,17 @@ - + - - - - - - + + + + + + - + @@ -55,7 +55,7 @@ - + @@ -66,14 +66,14 @@ - - - - - - + + + + + + - + @@ -102,7 +102,7 @@ - + @@ -116,7 +116,7 @@ - +