use of javax.cache.configuration.MutableConfiguration in project cache2k by cache2k.
the class CacheManagerTest method getCaches_MutateReturn.
@Test
public void getCaches_MutateReturn() {
CacheManager cacheManager = getCacheManager();
cacheManager.createCache("c1", new MutableConfiguration());
Cache cache1 = cacheManager.getCache("c1");
try {
Iterator iterator = cacheManager.getCacheNames().iterator();
iterator.next();
iterator.remove();
fail();
} catch (UnsupportedOperationException e) {
// immutable
}
}
use of javax.cache.configuration.MutableConfiguration in project cache2k by cache2k.
the class CacheManagerTest method getOrCreateCache_Same.
@Test
public void getOrCreateCache_Same() {
String name = "c1";
CacheManager cacheManager = getCacheManager();
cacheManager.createCache(name, new MutableConfiguration());
Cache cache = cacheManager.getCache(name);
assertSame(cache, cacheManager.getCache(name));
}
use of javax.cache.configuration.MutableConfiguration in project cache2k by cache2k.
the class CacheManagerTest method removeCache_There.
@Test
public void removeCache_There() {
CacheManager cacheManager = getCacheManager();
String name1 = "c1";
cacheManager.createCache(name1, new MutableConfiguration());
cacheManager.destroyCache(name1);
assertFalse(cacheManager.getCacheNames().iterator().hasNext());
}
use of javax.cache.configuration.MutableConfiguration in project cache2k by cache2k.
the class CacheManagerTest method close_cachesClosed.
@Test
public void close_cachesClosed() {
CacheManager cacheManager = getCacheManager();
cacheManager.createCache("c1", new MutableConfiguration());
Cache cache1 = cacheManager.getCache("c1");
cacheManager.createCache("c2", new MutableConfiguration());
Cache cache2 = cacheManager.getCache("c2");
cacheManager.close();
ensureClosed(cache1);
ensureClosed(cache2);
}
use of javax.cache.configuration.MutableConfiguration in project cache2k by cache2k.
the class CacheManagerTest method getOrCreateCache_NameOK.
@Test
public void getOrCreateCache_NameOK() {
String name = "c1";
getCacheManager().createCache(name, new MutableConfiguration());
Cache cache = getCacheManager().getCache(name);
assertEquals(name, cache.getName());
}
Aggregations