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;
}
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());
}
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());
}
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);
}
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);
}
Aggregations