Search in sources :

Example 31 with CacheSimpleConfig

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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 32 with CacheSimpleConfig

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;
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) HotRestartConfig(com.hazelcast.config.HotRestartConfig) WanReplicationRef(com.hazelcast.config.WanReplicationRef) EventJournalConfig(com.hazelcast.config.EventJournalConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig)

Example 33 with CacheSimpleConfig

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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 34 with CacheSimpleConfig

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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 35 with CacheSimpleConfig

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);
}
Also used : TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)84 Test (org.junit.Test)41 Config (com.hazelcast.config.Config)40 QuickTest (com.hazelcast.test.annotation.QuickTest)37 EvictionConfig (com.hazelcast.config.EvictionConfig)17 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)17 BeforeClass (org.junit.BeforeClass)16 CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)15 MapConfig (com.hazelcast.config.MapConfig)11 ClientConfig (com.hazelcast.client.config.ClientConfig)10 EventJournalConfig (com.hazelcast.config.EventJournalConfig)10 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)10 HazelcastInstance (com.hazelcast.core.HazelcastInstance)10 ExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig)9 QuorumConfig (com.hazelcast.config.QuorumConfig)9 CacheConfig (com.hazelcast.config.CacheConfig)8 TimedExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig)8 QueueConfig (com.hazelcast.config.QueueConfig)8 CacheSimpleEntryListenerConfig (com.hazelcast.config.CacheSimpleEntryListenerConfig)7 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)7