use of com.hazelcast.test.starter.constructor.DynamicConfigurationAwareConfigConstructor 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());
}
Aggregations