Logger logger = Logger.getLogger(CacheFactoryRegistry.class);
Level level = logger.getLevel();
assertEquals("org.castor.cache.Factories", CPAProperties.CACHE_FACTORIES);
AbstractProperties properties = CPAProperties.newInstance();
String memF = properties.getString(CPAProperties.CACHE_FACTORIES);
properties.remove(CPAProperties.CACHE_FACTORIES);
new CacheFactoryRegistry(properties);
properties.put(CPAProperties.CACHE_FACTORIES, "");
new CacheFactoryRegistry(properties);
properties.put(CPAProperties.CACHE_FACTORIES, UnlimitedFactory.class.getName());
new CacheFactoryRegistry(properties);
if (DISABLE_LOGGING) { logger.setLevel(Level.FATAL); }
properties.put(CPAProperties.CACHE_FACTORIES, "org.castor.cache.simple.UnknownFactory");
try {
new CacheFactoryRegistry(properties);
fail("Should have failed to create unknown class.");
} catch (PropertiesException ex) {
assertTrue(true);
}
logger.setLevel(level);
properties.put(CPAProperties.CACHE_FACTORIES, memF);
}