Search in sources :

Example 1 with KeeperContainerCreateInfo

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);
}
Also used : KeeperContainerCreateInfo(com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo) Test(org.junit.Test)

Example 2 with KeeperContainerCreateInfo

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);
}
Also used : KeepercontainerTbl(com.ctrip.xpipe.redis.console.model.KeepercontainerTbl) KeeperContainerCreateInfo(com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo) Test(org.junit.Test)

Example 3 with KeeperContainerCreateInfo

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;
    }
}
Also used : KeeperContainerCreateInfo(com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

KeeperContainerCreateInfo (com.ctrip.xpipe.redis.console.controller.api.data.meta.KeeperContainerCreateInfo)3 Test (org.junit.Test)3 KeepercontainerTbl (com.ctrip.xpipe.redis.console.model.KeepercontainerTbl)1 IOException (java.io.IOException)1