use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.
the class DeleteKeeperCommandTest method beforeDeleteKeeperCommandTest.
@Before
public void beforeDeleteKeeperCommandTest() {
keeperMeta = new KeeperMeta();
keeperMeta.setIp("localhost");
keeperMeta.setPort(randomPort());
deleteKeeperCommand = new DeleteKeeperCommand(keeperContainerService, new KeeperTransMeta(clusterId, shardId, keeperMeta), scheduled, timeoutMilli, checkIntervalMili);
}
use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.
the class DefaultKeeperStateControllerTest method testAdd.
@Test
public void testAdd() {
Assert.assertFalse(addCommand.isBeginExecute());
defaultKeeperStateController.addKeeper(new KeeperTransMeta(getClusterId(), getShardId(), new KeeperMeta()));
sleep(10);
Assert.assertTrue(addCommand.isBeginExecute());
}
use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.
the class DefaultKeeperStateControllerTest method testDelete.
@Test
public void testDelete() throws TimeoutException {
Assert.assertFalse(deleteCommand.isBeginExecute());
defaultKeeperStateController.removeKeeper(new KeeperTransMeta(getClusterId(), getShardId(), new KeeperMeta()));
waitConditionUntilTimeOut(() -> deleteCommand.isBeginExecute(), 1000);
}
use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.
the class AddKeeperCommandTest method beforeAddKeeperCommandTest.
@Before
public void beforeAddKeeperCommandTest() {
KeeperMeta keeperMeta = new KeeperMeta();
keeperMeta.setPort(keeperPort);
keeperMeta.setIp("localhost");
keeperTransMeta = new KeeperTransMeta("clusterId", "shardId", keeperMeta);
addKeeperCommand = new AddKeeperCommand(keeperContainerService, keeperTransMeta, scheduled, timeoutMilli, checkInterval);
}
use of com.ctrip.xpipe.redis.core.entity.KeeperTransMeta in project x-pipe by ctripcorp.
the class KeeperContainerServiceTest method setUp.
@Before
public void setUp() throws Exception {
keeperContainerService = new KeeperContainerService();
ReflectionTestUtils.setField(keeperContainerService, "leaderElectorManager", leaderElectorManager);
ReflectionTestUtils.setField(keeperContainerService, "metaService", metaService);
ReflectionTestUtils.setField(keeperContainerService, "leaderElectorManager", leaderElectorManager);
ReflectionTestUtils.setField(keeperContainerService, "keeperContainerConfig", keeperContainerConfig);
ReflectionTestUtils.setField(keeperContainerService, "keeperConfig", keeperConfig);
ReflectionTestUtils.setField(keeperContainerService, "keepersMonitorManager", keepersMonitorManager);
someCluster = "someCluster";
someShard = "someShard";
somePort = 6789;
someKeeperMeta = new KeeperMeta();
someKeeperMeta.setPort(somePort);
someKeeperTransMeta = new KeeperTransMeta();
someKeeperTransMeta.setClusterId(someCluster);
someKeeperTransMeta.setShardId(someShard);
someKeeperTransMeta.setKeeperMeta(someKeeperMeta);
when(keeperContainerConfig.getReplicationStoreDir()).thenReturn(System.getProperty("user.dir"));
ReflectionTestUtils.setField(ComponentRegistryHolder.class, "componentRegistry", componentRegistry);
}
Aggregations