Search in sources :

Example 1 with ConfigConstructor

use of com.hazelcast.test.starter.constructor.ConfigConstructor 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)

Aggregations

Config (com.hazelcast.config.Config)1 ListConfig (com.hazelcast.config.ListConfig)1 ListenerConfig (com.hazelcast.config.ListenerConfig)1 MapConfig (com.hazelcast.config.MapConfig)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 ConfigConstructor (com.hazelcast.test.starter.constructor.ConfigConstructor)1 Test (org.junit.Test)1