BAEL-5629 fix integration test for jcache article

This commit is contained in:
thibault.faure 2022-10-06 21:43:20 +02:00
parent 1f1d49bcb1
commit 879c0b8825
2 changed files with 5 additions and 4 deletions

View File

@ -174,7 +174,7 @@
<gson.version>2.8.2</gson.version>
<cache.version>1.1.1</cache.version>
<flink.version>1.5.0</flink.version>
<hazelcast.version>3.8.4</hazelcast.version>
<hazelcast.version>5.2.0</hazelcast.version>
<org.apache.crunch.crunch-core.version>0.15.0</org.apache.crunch.crunch-core.version>
<org.apache.hadoop.hadoop-client>2.2.0</org.apache.hadoop.hadoop-client>
<jmapper.version>1.6.0.1</jmapper.version>

View File

@ -16,21 +16,22 @@ import org.junit.Test;
public class CacheLoaderIntegrationTest {
private static final String CACHE_NAME = "SimpleCache";
private static final String HAZELCAST_MEMBER_CACHING_PROVIDER = "com.hazelcast.cache.HazelcastMemberCachingProvider";
private Cache<Integer, String> cache;
@Before
public void setup() {
// Adding fully qualified class name because of multiple Cache Provider (Ignite and Hazelcast)
CachingProvider cachingProvider = Caching.getCachingProvider("com.hazelcast.cache.HazelcastCachingProvider");
CachingProvider cachingProvider = Caching.getCachingProvider(HAZELCAST_MEMBER_CACHING_PROVIDER);
CacheManager cacheManager = cachingProvider.getCacheManager();
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( CACHE_NAME, config );
}
@After
public void tearDown() {
Caching.getCachingProvider("com.hazelcast.cache.HazelcastCachingProvider").getCacheManager().destroyCache(CACHE_NAME);
Caching.getCachingProvider(HAZELCAST_MEMBER_CACHING_PROVIDER).getCacheManager().destroyCache(CACHE_NAME);
}
@Test