Add missing cache-resolver attribute
Prior to this commit, CacheResolver could not be configured through the XML namespace (i.e. cache:annotation-driven). This is now the case. Issue: SPR-11490
This commit is contained in:
@@ -28,6 +28,7 @@ import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
/**
|
||||
* @author Costin Leau
|
||||
* @author Chris Beams
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class AnnotationNamespaceDrivenTests extends AbstractAnnotationTests {
|
||||
|
||||
@@ -44,6 +45,26 @@ public class AnnotationNamespaceDrivenTests extends AbstractAnnotationTests {
|
||||
assertSame(ctx.getBean("keyGenerator"), ci.getKeyGenerator());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cacheResolver() {
|
||||
ConfigurableApplicationContext context = new GenericXmlApplicationContext(
|
||||
"/org/springframework/cache/config/annotationDrivenCacheNamespace-resolver.xml");
|
||||
|
||||
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
|
||||
assertSame(context.getBean("cacheResolver"), ci.getCacheResolver());
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bothSetOnlyResolverIsUsed() {
|
||||
ConfigurableApplicationContext context = new GenericXmlApplicationContext(
|
||||
"/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml");
|
||||
|
||||
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
|
||||
assertSame(context.getBean("cacheResolver"), ci.getCacheResolver());
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCacheErrorHandler() {
|
||||
CacheInterceptor ci = ctx.getBean("org.springframework.cache.interceptor.CacheInterceptor#0",
|
||||
|
||||
Reference in New Issue
Block a user