Пример #1
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());
 }
Пример #2
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());
 }
Пример #3
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());
 }