use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testCacheSplitBrainProtectionRef.
@Test
public void testCacheSplitBrainProtectionRef() {
CacheSimpleConfig expectedConfig = new CacheSimpleConfig().setName("testCache").setSplitBrainProtectionName("testSplitBrainProtection");
Config config = new Config().addCacheConfig(expectedConfig);
Config decConfig = getNewConfigViaGenerator(config);
CacheSimpleConfig actualConfig = decConfig.getCacheConfig("testCache");
assertEquals("testSplitBrainProtection", actualConfig.getSplitBrainProtectionName());
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testCacheFactoryAttributes.
@Test
public void testCacheFactoryAttributes() {
CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = new CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig(ACCESSED, new CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig(10, SECONDS));
CacheSimpleConfig expectedConfig = new CacheSimpleConfig().setName("testCache").setCacheLoaderFactory("cacheLoaderFactory").setCacheWriterFactory("cacheWriterFactory").setExpiryPolicyFactory("expiryPolicyFactory").setCacheEntryListeners(singletonList(cacheSimpleEntryListenerConfig())).setExpiryPolicyFactoryConfig(new CacheSimpleConfig.ExpiryPolicyFactoryConfig(timedExpiryPolicyFactoryConfig)).setPartitionLostListenerConfigs(singletonList(new CachePartitionLostListenerConfig("partitionLostListener")));
expectedConfig.getMergePolicyConfig().setPolicy("mergePolicy");
expectedConfig.setDisablePerEntryInvalidationEvents(true);
Config config = new Config().addCacheConfig(expectedConfig);
Config decConfig = getNewConfigViaGenerator(config);
CacheSimpleConfig actualConfig = decConfig.getCacheConfig("testCache");
assertEquals(expectedConfig, actualConfig);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class Sources_withEventJournalTest method setUp.
@BeforeClass
public static void setUp() {
Config config = new Config();
config.setClusterName(randomName());
config.addCacheConfig(new CacheSimpleConfig().setName("*"));
config.getMapConfig(JOURNALED_MAP_PREFIX + '*').getEventJournalConfig().setEnabled(true);
config.getCacheConfig(JOURNALED_CACHE_PREFIX + '*').getEventJournalConfig().setEnabled(true);
remoteHz = createRemoteCluster(config, 2).get(0);
clientConfig = getClientConfigForRemoteCluster(remoteHz);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method checkCacheConfig_withEntryCountMaxSizePolicy_NATIVE.
@Test(expected = IllegalArgumentException.class)
public void checkCacheConfig_withEntryCountMaxSizePolicy_NATIVE() {
EvictionConfig evictionConfig = new EvictionConfig().setMaxSizePolicy(MaxSizePolicy.ENTRY_COUNT);
CacheSimpleConfig cacheSimpleConfig = new CacheSimpleConfig().setInMemoryFormat(NATIVE).setEvictionConfig(evictionConfig);
checkCacheConfig(cacheSimpleConfig, splitBrainMergePolicyProvider);
}
use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.
the class MergePolicyValidatorCacheIntegrationTest method addConfig.
@Override
void addConfig(Config config, String name, MergePolicyConfig mergePolicyConfig) {
CacheSimpleConfig cacheSimpleConfig = new CacheSimpleConfig();
cacheSimpleConfig.setName(name);
cacheSimpleConfig.setStatisticsEnabled(false);
cacheSimpleConfig.getMergePolicyConfig().setPolicy(mergePolicyConfig.getPolicy());
config.addCacheConfig(cacheSimpleConfig);
}
Aggregations