use of com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo in project x-pipe by ctripcorp.
the class KeepercontainerServiceImplTest method testAddKeeperContainer.
@Test(expected = IllegalArgumentException.class)
public void testAddKeeperContainer() {
KeeperContainerCreateInfo createInfo = new KeeperContainerCreateInfo();
keepercontainerService.addKeeperContainer(createInfo);
}
use of com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo in project x-pipe by ctripcorp.
the class KeepercontainerServiceImplTest method testAddKeeperContainer2.
@Test
public void testAddKeeperContainer2() {
KeeperContainerCreateInfo createInfo = new KeeperContainerCreateInfo().setDcName(dcNames[0]).setKeepercontainerIp("192.168.0.1").setKeepercontainerPort(9090).setKeepercontainerOrgId(3L);
keepercontainerService.addKeeperContainer(createInfo);
List<KeepercontainerTbl> result = keepercontainerService.findAllActiveByDcName(dcNames[0]);
KeepercontainerTbl target = null;
for (KeepercontainerTbl kc : result) {
if (kc.getKeepercontainerIp().equals("192.168.0.1") && kc.getKeepercontainerPort() == 9090) {
target = kc;
break;
}
}
Assert.assertNotNull(target);
}
use of com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo in project x-pipe by ctripcorp.
the class KeepercontainerServiceImplTest method testAddKeeperContainer3.
@Test(expected = IllegalArgumentException.class)
public void testAddKeeperContainer3() {
KeeperContainerCreateInfo createInfo = new KeeperContainerCreateInfo().setDcName(dcNames[0]).setKeepercontainerIp("192.168.0.1").setKeepercontainerPort(9090).setKeepercontainerOrgId(3L);
keepercontainerService.addKeeperContainer(createInfo);
try {
keepercontainerService.addKeeperContainer(createInfo);
} catch (Exception e) {
Assert.assertEquals("Keeper Container with IP: " + createInfo.getKeepercontainerIp() + " already exists", e.getMessage());
throw e;
}
}
Aggregations