40
40
import org .springframework .context .annotation .Configuration ;
41
41
42
42
/**
43
- *
44
43
* @author Stephane Nicoll
45
44
*/
46
- public class JCacheEhCacheTest extends AbstractAnnotationTests {
45
+ public class JCacheEhCacheTests extends AbstractAnnotationTests {
47
46
48
47
private CacheManager jCacheManager ;
49
48
49
+
50
50
@ Override
51
51
protected ConfigurableApplicationContext getApplicationContext () {
52
52
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext (EnableCachingConfig .class );
@@ -59,12 +59,14 @@ public void shutdown() {
59
59
jCacheManager .close ();
60
60
}
61
61
62
+
62
63
@ Override
63
64
@ Test
64
65
@ Ignore ("Multi cache manager support to be added" )
65
66
public void testCustomCacheManager () {
66
67
}
67
68
69
+
68
70
@ Configuration
69
71
@ EnableCaching
70
72
static class EnableCachingConfig extends CachingConfigurerSupport {
@@ -78,16 +80,11 @@ public org.springframework.cache.CacheManager cacheManager() {
78
80
@ Bean
79
81
public CacheManager jCacheManager () {
80
82
CacheManager cacheManager = Caching .getCachingProvider ().getCacheManager ();
81
- final MutableConfiguration <Object , Object > mutableConfiguration
82
- = new MutableConfiguration <Object , Object >();
83
- mutableConfiguration .setStoreByValue (false ); // Otherwise value has to be Serializable
84
- cacheManager .createCache ("testCache" ,
85
- new JCacheConfiguration <Object , Object >(mutableConfiguration ));
86
- cacheManager .createCache ("primary" ,
87
- new JCacheConfiguration <Object , Object >(mutableConfiguration ));
88
- cacheManager .createCache ("secondary" ,
89
- new JCacheConfiguration <Object , Object >(mutableConfiguration ));
90
-
83
+ MutableConfiguration <Object , Object > mutableConfiguration = new MutableConfiguration <Object , Object >();
84
+ mutableConfiguration .setStoreByValue (false ); // otherwise value has to be Serializable
85
+ cacheManager .createCache ("testCache" , new JCacheConfiguration <Object , Object >(mutableConfiguration ));
86
+ cacheManager .createCache ("primary" , new JCacheConfiguration <Object , Object >(mutableConfiguration ));
87
+ cacheManager .createCache ("secondary" , new JCacheConfiguration <Object , Object >(mutableConfiguration ));
91
88
return cacheManager ;
92
89
}
93
90
@@ -111,6 +108,6 @@ public KeyGenerator keyGenerator() {
111
108
public KeyGenerator customKeyGenerator () {
112
109
return new SomeCustomKeyGenerator ();
113
110
}
114
-
115
111
}
116
- }
112
+
113
+ }
0 commit comments