Search in sources :

Example 1 with SimpleCacheResolver

use of cn.taketoday.cache.interceptor.SimpleCacheResolver in project today-framework by TAKETODAY.

the class JCacheJavaConfigTests method emptyConfigSupport.

@Test
public void emptyConfigSupport() {
    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
    DefaultJCacheOperationSource cos = context.getBean(DefaultJCacheOperationSource.class);
    assertThat(cos.getCacheResolver()).isNotNull();
    assertThat(cos.getCacheResolver().getClass()).isEqualTo(SimpleCacheResolver.class);
    assertThat(((SimpleCacheResolver) cos.getCacheResolver()).getCacheManager()).isSameAs(context.getBean(CacheManager.class));
    assertThat(cos.getExceptionCacheResolver()).isNull();
    context.close();
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) AnnotationConfigApplicationContext(cn.taketoday.context.annotation.AnnotationConfigApplicationContext) DefaultJCacheOperationSource(cn.taketoday.cache.jcache.interceptor.DefaultJCacheOperationSource) NoOpCacheManager(cn.taketoday.cache.support.NoOpCacheManager) ConcurrentMapCacheManager(cn.taketoday.cache.concurrent.ConcurrentMapCacheManager) SimpleCacheManager(cn.taketoday.cache.support.SimpleCacheManager) CacheManager(cn.taketoday.cache.CacheManager) SimpleCacheResolver(cn.taketoday.cache.interceptor.SimpleCacheResolver) Test(org.junit.jupiter.api.Test)

Example 2 with SimpleCacheResolver

use of cn.taketoday.cache.interceptor.SimpleCacheResolver in project today-framework by TAKETODAY.

the class EnableCachingTests method emptyConfigSupport.

@Test
public void emptyConfigSupport() {
    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
    CacheInterceptor ci = context.getBean(CacheInterceptor.class);
    assertThat(ci.getCacheResolver()).isNotNull();
    assertThat(ci.getCacheResolver().getClass()).isEqualTo(SimpleCacheResolver.class);
    assertThat(((SimpleCacheResolver) ci.getCacheResolver()).getCacheManager()).isSameAs(context.getBean(CacheManager.class));
    context.close();
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) AnnotationConfigApplicationContext(cn.taketoday.context.annotation.AnnotationConfigApplicationContext) NoOpCacheManager(cn.taketoday.cache.support.NoOpCacheManager) CacheManager(cn.taketoday.cache.CacheManager) SimpleCacheResolver(cn.taketoday.cache.interceptor.SimpleCacheResolver) CacheInterceptor(cn.taketoday.cache.interceptor.CacheInterceptor) Test(org.junit.jupiter.api.Test)

Example 3 with SimpleCacheResolver

use of cn.taketoday.cache.interceptor.SimpleCacheResolver in project today-infrastructure by TAKETODAY.

the class JCacheJavaConfigTests method emptyConfigSupport.

@Test
public void emptyConfigSupport() {
    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
    DefaultJCacheOperationSource cos = context.getBean(DefaultJCacheOperationSource.class);
    assertThat(cos.getCacheResolver()).isNotNull();
    assertThat(cos.getCacheResolver().getClass()).isEqualTo(SimpleCacheResolver.class);
    assertThat(((SimpleCacheResolver) cos.getCacheResolver()).getCacheManager()).isSameAs(context.getBean(CacheManager.class));
    assertThat(cos.getExceptionCacheResolver()).isNull();
    context.close();
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) AnnotationConfigApplicationContext(cn.taketoday.context.annotation.AnnotationConfigApplicationContext) DefaultJCacheOperationSource(cn.taketoday.cache.jcache.interceptor.DefaultJCacheOperationSource) NoOpCacheManager(cn.taketoday.cache.support.NoOpCacheManager) ConcurrentMapCacheManager(cn.taketoday.cache.concurrent.ConcurrentMapCacheManager) SimpleCacheManager(cn.taketoday.cache.support.SimpleCacheManager) CacheManager(cn.taketoday.cache.CacheManager) SimpleCacheResolver(cn.taketoday.cache.interceptor.SimpleCacheResolver) Test(org.junit.jupiter.api.Test)

Example 4 with SimpleCacheResolver

use of cn.taketoday.cache.interceptor.SimpleCacheResolver in project today-infrastructure by TAKETODAY.

the class EnableCachingTests method emptyConfigSupport.

@Test
public void emptyConfigSupport() {
    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
    CacheInterceptor ci = context.getBean(CacheInterceptor.class);
    assertThat(ci.getCacheResolver()).isNotNull();
    assertThat(ci.getCacheResolver().getClass()).isEqualTo(SimpleCacheResolver.class);
    assertThat(((SimpleCacheResolver) ci.getCacheResolver()).getCacheManager()).isSameAs(context.getBean(CacheManager.class));
    context.close();
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) AnnotationConfigApplicationContext(cn.taketoday.context.annotation.AnnotationConfigApplicationContext) NoOpCacheManager(cn.taketoday.cache.support.NoOpCacheManager) CacheManager(cn.taketoday.cache.CacheManager) SimpleCacheResolver(cn.taketoday.cache.interceptor.SimpleCacheResolver) CacheInterceptor(cn.taketoday.cache.interceptor.CacheInterceptor) Test(org.junit.jupiter.api.Test)

Aggregations

CacheManager (cn.taketoday.cache.CacheManager)4 SimpleCacheResolver (cn.taketoday.cache.interceptor.SimpleCacheResolver)4 NoOpCacheManager (cn.taketoday.cache.support.NoOpCacheManager)4 ConfigurableApplicationContext (cn.taketoday.context.ConfigurableApplicationContext)4 AnnotationConfigApplicationContext (cn.taketoday.context.annotation.AnnotationConfigApplicationContext)4 Test (org.junit.jupiter.api.Test)4 ConcurrentMapCacheManager (cn.taketoday.cache.concurrent.ConcurrentMapCacheManager)2 CacheInterceptor (cn.taketoday.cache.interceptor.CacheInterceptor)2 DefaultJCacheOperationSource (cn.taketoday.cache.jcache.interceptor.DefaultJCacheOperationSource)2 SimpleCacheManager (cn.taketoday.cache.support.SimpleCacheManager)2