use of org.cache2k.jcache.provider.generic.storeByValueSimulation.CopyCacheProxy in project cache2k by cache2k.
the class CacheManagerTest method create_cache2k_config_nowrap.
@Test
public void create_cache2k_config_nowrap() {
CachingProvider p = Caching.getCachingProvider();
CacheManager cm = p.getCacheManager();
Cache<Long, Double> cache = cm.createCache("aCache", ExtendedMutableConfiguration.of(new Cache2kBuilder<Long, Double>() {
}.entryCapacity(10000).expireAfterWrite(5, TimeUnit.MINUTES)));
assertFalse(cache instanceof CopyCacheProxy);
cache.close();
}
use of org.cache2k.jcache.provider.generic.storeByValueSimulation.CopyCacheProxy in project cache2k by cache2k.
the class CacheManagerTest method create_cache2k_config_wrap.
@Test
public void create_cache2k_config_wrap() {
CachingProvider p = Caching.getCachingProvider();
CacheManager cm = p.getCacheManager();
Cache<Long, Double> cache = cm.createCache("aCache", ExtendedMutableConfiguration.of(new Cache2kBuilder<Long, Double>() {
}.entryCapacity(10000).expireAfterWrite(5, TimeUnit.MINUTES).with(new JCacheConfiguration.Builder().copyAlwaysIfRequested(true))));
assertTrue(cache instanceof CopyCacheProxy);
cache.close();
}
Aggregations