add fully qualified class name
Add fully qualified class name because of multiple cache providers like iginte and hazelcast
This commit is contained in:
parent
2e119f774f
commit
c319fbafca
|
@ -21,7 +21,8 @@ public class CacheLoaderTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
CachingProvider cachingProvider = Caching.getCachingProvider();
|
// Adding fully qualified class name because of multiple Cache Provider (Ignite and Hazelcast)
|
||||||
|
CachingProvider cachingProvider = Caching.getCachingProvider("com.hazelcast.cache.HazelcastCachingProvider");
|
||||||
CacheManager cacheManager = cachingProvider.getCacheManager();
|
CacheManager cacheManager = cachingProvider.getCacheManager();
|
||||||
MutableConfiguration<Integer, String> config = new MutableConfiguration<Integer, String>().setReadThrough(true).setCacheLoaderFactory(new FactoryBuilder.SingletonFactory<>(new SimpleCacheLoader()));
|
MutableConfiguration<Integer, String> config = new MutableConfiguration<Integer, String>().setReadThrough(true).setCacheLoaderFactory(new FactoryBuilder.SingletonFactory<>(new SimpleCacheLoader()));
|
||||||
this.cache = cacheManager.createCache("SimpleCache", config);
|
this.cache = cacheManager.createCache("SimpleCache", config);
|
||||||
|
@ -29,7 +30,7 @@ public class CacheLoaderTest {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
Caching.getCachingProvider().getCacheManager().destroyCache(CACHE_NAME);
|
Caching.getCachingProvider("com.hazelcast.cache.HazelcastCachingProvider").getCacheManager().destroyCache(CACHE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -39,4 +40,4 @@ public class CacheLoaderTest {
|
||||||
assertEquals("fromCache" + i, value);
|
assertEquals("fromCache" + i, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue