Search in sources :

Example 16 with ConcurrentMapCache

use of org.springframework.cache.concurrent.ConcurrentMapCache in project spring-framework by spring-projects.

the class ExpressionEvaluatorTests method createEvaluationContext.

private EvaluationContext createEvaluationContext(Object result, BeanFactory beanFactory) {
    AnnotatedClass target = new AnnotatedClass();
    Method method = ReflectionUtils.findMethod(AnnotatedClass.class, "multipleCaching", Object.class, Object.class);
    Object[] args = new Object[] { new Object(), new Object() };
    Collection<ConcurrentMapCache> caches = Collections.singleton(new ConcurrentMapCache("test"));
    return this.eval.createEvaluationContext(caches, method, args, target, target.getClass(), result, beanFactory);
}
Also used : ConcurrentMapCache(org.springframework.cache.concurrent.ConcurrentMapCache) Method(java.lang.reflect.Method)

Aggregations

ConcurrentMapCache (org.springframework.cache.concurrent.ConcurrentMapCache)16 Cache (org.springframework.cache.Cache)10 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)6 Before (org.junit.Before)4 ClassPathResource (org.springframework.core.io.ClassPathResource)4 TransactionStatus (org.springframework.transaction.TransactionStatus)3 DefaultTransactionAttribute (org.springframework.transaction.interceptor.DefaultTransactionAttribute)3 Method (java.lang.reflect.Method)2 HashMap (java.util.HashMap)2 SimpleCacheManager (org.springframework.cache.support.SimpleCacheManager)2 AnnotatedElementKey (org.springframework.context.expression.AnnotatedElementKey)1 EvaluationContext (org.springframework.expression.EvaluationContext)1