JChannelFactory cf = new JChannelFactory();
cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
registry.start();
ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
Set<String> configNames = registry.getConfigurationNames();
assertEquals(7, configNames.size());
Set<String> cacheNames = registry.getCacheNames();
assertEquals(0, cacheNames.size());
for (String configName : configNames)
{
assertNull(configName + " not created", registry.getCache(configName, false));
Cache<Object, Object> cache = registry.getCache(configName, true);
caches.add(cache);
// Cache shouldn't be started
assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
cache.create();
cache.start();
// Config should be a clone
Configuration rawConfig = configRegistry.getConfiguration(configName);
Configuration realConfig = cache.getConfiguration();
assertFalse(rawConfig == realConfig);
assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
}