Set<Cache> caches = new HashSet<Cache>();
for (String name : cores)
{
Cache cache = registry.getCache(name, false);
assertNotNull(cache);
assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
caches.add(cache);
}
for (String name : pojos)
{
PojoCache pojocache = registry.getPojoCache(name, false);
assertNotNull(pojocache);
Cache cache = pojocache.getCache();
assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
caches.add(cache);
}
for (String name : cores)
{
registry.releaseCache(name);
}
for (String name : pojos)
{
registry.releaseCache(name);
}
for (Cache cache : caches)
{
assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
}
registry.stop();
for (Cache cache : caches)
{
assertEquals(CacheStatus.DESTROYED, cache.getCacheStatus());
}
}