Search in sources :

Example 6 with KeeperTransMeta

use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.

the class KeeperContainerServiceTest method testAddKeeperWithSamePortMultipleTimes.

@Test(expected = RedisKeeperRuntimeException.class)
public void testAddKeeperWithSamePortMultipleTimes() throws Exception {
    String anotherShard = "anotherShard";
    KeeperMeta anotherKeeperMeta = new KeeperMeta();
    anotherKeeperMeta.setPort(somePort);
    KeeperTransMeta anotherKeeperTransMeta = new KeeperTransMeta();
    anotherKeeperTransMeta.setKeeperMeta(anotherKeeperMeta);
    anotherKeeperTransMeta.setClusterId(someCluster);
    anotherKeeperTransMeta.setShardId(anotherShard);
    keeperContainerService.add(someKeeperTransMeta);
    keeperContainerService.add(anotherKeeperTransMeta);
}
Also used : KeeperTransMeta(com.ctrip.xpipe.redis.core.entity.KeeperTransMeta) KeeperMeta(com.ctrip.xpipe.redis.core.entity.KeeperMeta) Test(org.junit.Test)

Aggregations

KeeperMeta (com.ctrip.xpipe.redis.core.entity.KeeperMeta)6 KeeperTransMeta (com.ctrip.xpipe.redis.core.entity.KeeperTransMeta)6 Before (org.junit.Before)3 Test (org.junit.Test)3 AbstractMetaServerTest (com.ctrip.xpipe.redis.meta.server.AbstractMetaServerTest)2