@Test public void testManagementCenterConfig() { ManagementCenterConfig managementCenterConfig = config.getManagementCenterConfig(); assertNotNull(managementCenterConfig); assertTrue(managementCenterConfig.isEnabled()); assertEquals("myserver:80", managementCenterConfig.getUrl()); assertEquals(4, managementCenterConfig.getUpdateInterval()); }
@Test public void testEmptyManagementCenterConfig() { String xml = "<hazelcast>\n" + "</hazelcast>"; final Config config = buildConfig(xml); final ManagementCenterConfig manCenterCfg = config.getManagementCenterConfig(); assertFalse(manCenterCfg.isEnabled()); assertNull(manCenterCfg.getClusterId()); assertNull(manCenterCfg.getSecurityToken()); assertNull(manCenterCfg.getUrl()); }
@Test public void testManagementCenterConfig_onlySecurityTokenSet() { String xml = "<hazelcast>\n" + "<management-center security-token=\"someToken\">" + "</management-center>" + "</hazelcast>"; final Config config = buildConfig(xml); final ManagementCenterConfig manCenterCfg = config.getManagementCenterConfig(); assertTrue(manCenterCfg.isEnabled()); assertEquals("someToken", manCenterCfg.getSecurityToken()); assertNull(manCenterCfg.getClusterId()); assertNull(manCenterCfg.getUrl()); }
@Test public void testNotEnabledWithURLManagementCenterConfig() { String xml = "<hazelcast>\n" + "<management-center enabled=\"false\">" + "http://localhost:8080/mancenter" + "</management-center>" + "</hazelcast>"; final Config config = buildConfig(xml); final ManagementCenterConfig manCenterCfg = config.getManagementCenterConfig(); assertFalse(manCenterCfg.isEnabled()); assertNull(manCenterCfg.getClusterId()); assertNull(manCenterCfg.getSecurityToken()); assertEquals("http://localhost:8080/mancenter", manCenterCfg.getUrl()); }