@Test
 public void testManagementCenterConfig() {
   ManagementCenterConfig managementCenterConfig = config.getManagementCenterConfig();
   assertNotNull(managementCenterConfig);
   assertTrue(managementCenterConfig.isEnabled());
   assertEquals("myserver:80", managementCenterConfig.getUrl());
   assertEquals(4, managementCenterConfig.getUpdateInterval());
 }
Exemplo n.º 2
0
 @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());
 }
Exemplo n.º 3
0
 @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());
 }
Exemplo n.º 4
0
 @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());
 }