use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testCacheConfig_withPartitionLostListenerByImplementation.
@Test
public void testCacheConfig_withPartitionLostListenerByImplementation() {
CacheSimpleConfig config = getCacheConfig().addCachePartitionLostListenerConfig(new CachePartitionLostListenerConfig(new SampleCachePartitionLostListener()));
driver.getConfig().addCacheConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method getCacheConfig.
private CacheSimpleConfig getCacheConfig() {
CacheSimpleEntryListenerConfig entryListenerConfig = new CacheSimpleEntryListenerConfig();
entryListenerConfig.setCacheEntryListenerFactory("CacheEntryListenerFactory");
entryListenerConfig.setSynchronous(true);
entryListenerConfig.setOldValueRequired(true);
entryListenerConfig.setCacheEntryEventFilterFactory("CacheEntryEventFilterFactory");
CacheSimpleConfig config = new CacheSimpleConfig().setName(name).setSplitBrainProtectionName("split-brain-protection").setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(3).setAsyncBackupCount(2).addEntryListenerConfig(entryListenerConfig).setStatisticsEnabled(true).setManagementEnabled(true).setKeyType("keyType").setValueType("valueType").setReadThrough(true).setWriteThrough(true).setHotRestartConfig(new HotRestartConfig().setEnabled(true).setFsync(true)).setEventJournalConfig(new EventJournalConfig().setEnabled(true).setCapacity(42).setTimeToLiveSeconds(52));
config.setWanReplicationRef(new WanReplicationRef(randomName(), "com.hazelcast.MergePolicy", Collections.singletonList("filter"), true));
config.getMergePolicyConfig().setPolicy("mergePolicy");
config.setDisablePerEntryInvalidationEvents(true);
return config;
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testCacheConfig_withPartitionLostListenerByClassName.
@Test
public void testCacheConfig_withPartitionLostListenerByClassName() {
CacheSimpleConfig config = getCacheConfig().addCachePartitionLostListenerConfig(new CachePartitionLostListenerConfig("partitionLostListener"));
driver.getConfig().addCacheConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testCacheConfig_withEvictionPolicyImplementation_cacheLoaderAndWriterFactory.
@Test
public void testCacheConfig_withEvictionPolicyImplementation_cacheLoaderAndWriterFactory() {
CacheSimpleConfig config = getCacheConfig().setEvictionConfig(getEvictionConfigByImplementation()).setCacheLoaderFactory("com.hazelcast.CacheLoaderFactory").setCacheWriterFactory("com.hazelcast.CacheWriterFactory");
driver.getConfig().addCacheConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testCacheConfig.
@Test
public void testCacheConfig() {
CacheSimpleConfig config = getCacheConfig().setExpiryPolicyFactoryConfig(new ExpiryPolicyFactoryConfig("expiryPolicyFactory"));
driver.getConfig().addCacheConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
Aggregations