Permalink
Browse files

ISPN-2055 Revert change to create AbstractCacheLoaderConfig instances

* Tightened UnnnecessaryLoadingTest in order to avoid leaking cache
manager instances if there's any issues in getCache().
  • Loading branch information...
galderz committed May 22, 2012
1 parent 4f57342 commit c6de5b240aaf43f78027b691b1ff2ed4e141efbd
@@ -243,7 +243,7 @@ public static CacheLoaderConfig adapt(AbstractLoaderConfiguration loader) {
if (cacheLoader.getClass().isAnnotationPresent(CacheLoaderMetadata.class)) {
clc = Util.getInstance(cacheLoader.getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
} else {
- AbstractCacheLoaderConfig acsc = new AbstractCacheLoaderConfig();
+ AbstractCacheStoreConfig acsc = new AbstractCacheStoreConfig();
acsc.setCacheLoaderClassName(((LoaderConfiguration) loader).cacheLoader().getClass().getName());
clc = acsc;
}
@@ -63,10 +63,13 @@ protected EmbeddedCacheManager createCacheManager() throws Exception {
clmc.addCacheLoaderConfig(new CountingCacheStoreConfig());
clmc.addCacheLoaderConfig(new DummyInMemoryCacheStore.Cfg());
cfg.setCacheLoaderManagerConfig(clmc);
- EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
- cache = cm.getCache();
+ return TestCacheManagerFactory.createCacheManager(cfg);
+ }
+
+ @Override
+ protected void setup() throws Exception {
+ super.setup();
store = TestingUtil.extractComponent(cache, CacheLoaderManager.class).getCacheStore();
- return cm;
}
public void testRepeatedLoads() throws CacheLoaderException {

0 comments on commit c6de5b2

Please sign in to comment.