use of com.hazelcast.config.SetConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testSet.
// LIST
@Test
public void testSet() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(LatestUpdateMergePolicy.class.getName()).setBatchSize(1234);
SetConfig expectedConfig = new SetConfig("testSet").setMaxSize(10).setStatisticsEnabled(true).setBackupCount(2).setAsyncBackupCount(3).setSplitBrainProtectionName("splitBrainProtection").setMergePolicyConfig(mergePolicyConfig).setItemListenerConfigs(singletonList(new ItemListenerConfig("java.Listener", true)));
Config config = new Config().addSetConfig(expectedConfig);
Config decConfig = getNewConfigViaGenerator(config);
SetConfig actualConfig = decConfig.getSetConfig("testSet");
assertEquals(expectedConfig, actualConfig);
}
use of com.hazelcast.config.SetConfig in project hazelcast by hazelcast.
the class ConfigSearchTest method testSetConfig_Static.
@Test
public void testSetConfig_Static() {
TestCase<SetConfig> testCase = new TestCase<SetConfig>(new SetConfig().setName(STATIC_NAME), new SetConfig().setName(DYNAMIC_NAME), false) {
@Override
void addStaticConfig(Config config) {
config.addSetConfig(this.staticConfig);
}
@Override
void addDynamicConfig(HazelcastInstance hazelcastInstance) {
hazelcastInstance.getConfig().addSetConfig(this.dynamicConfig);
}
@Override
void asserts() {
SetConfig dataConfig = hazelcastInstance.getConfig().findSetConfig(DYNAMIC_NAME);
assertThat(dataConfig.getName(), equalTo(STATIC_NAME));
}
};
testTemplate(testCase);
}
use of com.hazelcast.config.SetConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.
private void assertConfigurationsEqualOnAllMembers(SetConfig setConfig) {
String name = setConfig.getName();
for (HazelcastInstance instance : members) {
SetConfig registeredConfig = instance.getConfig().getSetConfig(name);
assertEquals(setConfig, registeredConfig);
}
}
Aggregations