Search in sources :

Example 6 with ListConfig

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

the class AbstractSplitBrainProtectionTest method newListConfig.

protected static ListConfig newListConfig(SplitBrainProtectionOn splitBrainProtectionOn, String splitBrainProtectionName) {
    ListConfig config = new ListConfig(LIST_NAME + splitBrainProtectionOn.name());
    config.setSplitBrainProtectionName(splitBrainProtectionName);
    return config;
}
Also used : ListConfig(com.hazelcast.config.ListConfig)

Example 7 with ListConfig

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

the class DynamicConfigurationAwareConfigConstructorTest method testConstructor.

@Test
public void testConstructor() {
    Config config = new Config().setInstanceName("myInstanceName").addMapConfig(new MapConfig("myMap")).addListConfig(new ListConfig("myList")).addListenerConfig(new ListenerConfig("com.hazelcast.test.MyListenerConfig")).setProperties(buildPropertiesWithDefaults());
    HazelcastProperties properties = new HazelcastProperties(config);
    DynamicConfigurationAwareConfig dynamicConfig = new DynamicConfigurationAwareConfig(config, properties);
    DynamicConfigurationAwareConfigConstructor constructor = new DynamicConfigurationAwareConfigConstructor(DynamicConfigurationAwareConfig.class);
    DynamicConfigurationAwareConfig clonedDynamicConfig = (DynamicConfigurationAwareConfig) constructor.createNew(dynamicConfig);
    assertEquals(dynamicConfig.getInstanceName(), clonedDynamicConfig.getInstanceName());
    assertEquals(dynamicConfig.getMapConfigs().size(), clonedDynamicConfig.getMapConfigs().size());
    assertEquals(dynamicConfig.getListConfigs().size(), clonedDynamicConfig.getListConfigs().size());
    assertEquals(dynamicConfig.getListenerConfigs().size(), clonedDynamicConfig.getListenerConfigs().size());
    assertPropertiesEquals(dynamicConfig.getProperties(), clonedDynamicConfig.getProperties());
}
Also used : ListenerConfig(com.hazelcast.config.ListenerConfig) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config) ListConfig(com.hazelcast.config.ListConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) DynamicConfigurationAwareConfig(com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig) MapConfig(com.hazelcast.config.MapConfig) DynamicConfigurationAwareConfig(com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig) DynamicConfigurationAwareConfigConstructor(com.hazelcast.test.starter.constructor.DynamicConfigurationAwareConfigConstructor) MapConfig(com.hazelcast.config.MapConfig) ListConfig(com.hazelcast.config.ListConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 8 with ListConfig

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

the class ConfigConstructorTest method testConstructor.

@Test
public void testConstructor() {
    Config config = new Config().setInstanceName("myInstanceName").addMapConfig(new MapConfig("myMap")).addListConfig(new ListConfig("myList")).addListenerConfig(new ListenerConfig("com.hazelcast.test.MyListenerConfig")).setProperties(buildPropertiesWithDefaults());
    ConfigConstructor constructor = new ConfigConstructor(Config.class);
    Config clonedConfig = (Config) constructor.createNew(config);
    assertEquals(config.getInstanceName(), clonedConfig.getInstanceName());
    assertEquals(config.getMapConfigs().size(), clonedConfig.getMapConfigs().size());
    assertEquals(config.getListConfigs().size(), clonedConfig.getListConfigs().size());
    assertEquals(config.getListenerConfigs().size(), clonedConfig.getListenerConfigs().size());
    assertPropertiesEquals(config.getProperties(), clonedConfig.getProperties());
}
Also used : ListenerConfig(com.hazelcast.config.ListenerConfig) ConfigConstructor(com.hazelcast.test.starter.constructor.ConfigConstructor) Config(com.hazelcast.config.Config) ListConfig(com.hazelcast.config.ListConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) MapConfig(com.hazelcast.config.MapConfig) MapConfig(com.hazelcast.config.MapConfig) ListConfig(com.hazelcast.config.ListConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 9 with ListConfig

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

the class MergePolicyValidatorListIntegrationTest method addConfig.

@Override
void addConfig(Config config, String name, MergePolicyConfig mergePolicyConfig) {
    ListConfig listConfig = new ListConfig(name).setMergePolicyConfig(mergePolicyConfig);
    config.addListConfig(listConfig);
}
Also used : ListConfig(com.hazelcast.config.ListConfig)

Example 10 with ListConfig

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

the class AbstractDynamicConfigGeneratorTest method testList.

// LIST
@Test
public void testList() {
    MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(HigherHitsMergePolicy.class.getName()).setBatchSize(1234);
    ListConfig expectedConfig = new ListConfig("testList").setMaxSize(10).setStatisticsEnabled(true).setBackupCount(2).setAsyncBackupCount(3).setSplitBrainProtectionName("splitBrainProtection").setMergePolicyConfig(mergePolicyConfig).setItemListenerConfigs(singletonList(new ItemListenerConfig("java.Listener", true)));
    Config config = new Config().addListConfig(expectedConfig);
    Config decConfig = getNewConfigViaGenerator(config);
    ListConfig actualConfig = decConfig.getListConfig("testList");
    assertEquals(expectedConfig, actualConfig);
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ListConfig(com.hazelcast.config.ListConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) AwsConfig(com.hazelcast.config.AwsConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) DiscoveryStrategyConfig(com.hazelcast.config.DiscoveryStrategyConfig) DiskTierConfig(com.hazelcast.config.DiskTierConfig) IndexConfig(com.hazelcast.config.IndexConfig) NearCacheConfig(com.hazelcast.config.NearCacheConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) WanConsumerConfig(com.hazelcast.config.WanConsumerConfig) AttributeConfig(com.hazelcast.config.AttributeConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) WanCustomPublisherConfig(com.hazelcast.config.WanCustomPublisherConfig) WanBatchPublisherConfig(com.hazelcast.config.WanBatchPublisherConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) TieredStoreConfig(com.hazelcast.config.TieredStoreConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DiscoveryConfig(com.hazelcast.config.DiscoveryConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DataPersistenceConfig(com.hazelcast.config.DataPersistenceConfig) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) MerkleTreeConfig(com.hazelcast.config.MerkleTreeConfig) MemoryTierConfig(com.hazelcast.config.MemoryTierConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) ListConfig(com.hazelcast.config.ListConfig) Test(org.junit.Test)

Aggregations

ListConfig (com.hazelcast.config.ListConfig)21 Test (org.junit.Test)10 QuickTest (com.hazelcast.test.annotation.QuickTest)9 Config (com.hazelcast.config.Config)8 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)8 MapConfig (com.hazelcast.config.MapConfig)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)5 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)5 ExecutorConfig (com.hazelcast.config.ExecutorConfig)5 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 PNCounterConfig (com.hazelcast.config.PNCounterConfig)5 QueueConfig (com.hazelcast.config.QueueConfig)5 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)5 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)5 RingbufferConfig (com.hazelcast.config.RingbufferConfig)5 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)5 SetConfig (com.hazelcast.config.SetConfig)5 TopicConfig (com.hazelcast.config.TopicConfig)5