Search in sources :

Example 81 with CacheSimpleConfig

use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_DefaultMergePolicy.

@Test
public void cacheConfigXmlTest_DefaultMergePolicy() {
    assertNotNull(instance1);
    CacheSimpleConfig cacheWithDefaultMergePolicyConfig = instance1.getConfig().getCacheConfig("cacheWithDefaultMergePolicy");
    assertNotNull(cacheWithDefaultMergePolicyConfig);
    assertEquals(MergePolicyConfig.DEFAULT_MERGE_POLICY, cacheWithDefaultMergePolicyConfig.getMergePolicyConfig().getPolicy());
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 82 with CacheSimpleConfig

use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_PartitionLostListener.

@Test
public void cacheConfigXmlTest_PartitionLostListener() {
    Config config = instance1.getConfig();
    CacheSimpleConfig cacheWithPartitionLostListenerConfig = config.getCacheConfig("cacheWithPartitionLostListener");
    List<CachePartitionLostListenerConfig> partitionLostListenerConfigs = cacheWithPartitionLostListenerConfig.getPartitionLostListenerConfigs();
    assertNotNull(partitionLostListenerConfigs);
    assertEquals(1, partitionLostListenerConfigs.size());
    assertEquals(partitionLostListenerConfigs.get(0).getClassName(), "DummyCachePartitionLostListenerImpl");
    assertNotNull(partitionLostListenerConfigs);
    assertEquals(1, partitionLostListenerConfigs.size());
    assertEquals(partitionLostListenerConfigs.get(0).getClassName(), "DummyCachePartitionLostListenerImpl");
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) Config(com.hazelcast.config.Config) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 83 with CacheSimpleConfig

use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory.

@Test
public void cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory() {
    Config config = instance1.getConfig();
    CacheSimpleConfig cacheWithTimedCreatedExpiryPolicyFactoryConfig = config.getCacheConfig("cacheWithTimedCreatedExpiryPolicyFactory");
    ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedCreatedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
    ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
    DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
    assertNotNull(expiryPolicyFactoryConfig);
    assertNotNull(timedExpiryPolicyFactoryConfig);
    assertNotNull(durationConfig);
    assertNull(expiryPolicyFactoryConfig.getClassName());
    assertEquals(ExpiryPolicyType.CREATED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
    assertEquals(1, durationConfig.getDurationAmount());
    assertEquals(TimeUnit.DAYS, durationConfig.getTimeUnit());
}
Also used : ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) Config(com.hazelcast.config.Config) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 84 with CacheSimpleConfig

use of com.hazelcast.config.CacheSimpleConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_SimpleWriterLoader.

@Test
public void cacheConfigXmlTest_SimpleWriterLoader() {
    assertNotNull(instance1);
    CacheSimpleConfig config = instance1.getConfig().getCacheConfig("cacheWithSimpleWriterAndLoader");
    assertNotNull(config);
    assertEquals("com.hazelcast.config.CacheConfigTest$EmptyCacheWriter", config.getCacheWriter());
    assertEquals("com.hazelcast.config.CacheConfigTest$MyCacheLoader", config.getCacheLoader());
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) 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