use of com.ctrip.xpipe.redis.console.model.SetinelTbl in project x-pipe by ctripcorp.
the class SetinelServiceTest method testMetasService.
@Test
public void testMetasService() {
SetinelTbl target_setinel = new SetinelTbl().setSetinelId(1).setSetinelAddress("11111");
assertEquals(setinelService.findAllByDcName("NTGXH").get(0).getSetinelAddress(), target_setinel.getSetinelAddress());
}
use of com.ctrip.xpipe.redis.console.model.SetinelTbl in project x-pipe by ctripcorp.
the class SentinelServiceImplTest method testRandom.
@Test
public void testRandom() {
int testCount = 1 << 20;
Set<Long> all = new HashSet<>();
for (int i = 0; i < testCount; i++) {
SetinelTbl random = sentinelService.random(sentinels);
all.add(random.getSetinelId());
}
Assert.assertEquals(sentinels.size(), all.size());
}
Aggregations