Search in sources :

Example 1 with DefaultSentinelManager

use of com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultSentinelManager in project x-pipe by ctripcorp.

the class DefaultSentinelManagerTest method beforeDefaultSentinelManagerTest.

@Before
public void beforeDefaultSentinelManagerTest() throws Exception {
    sentinelManager = new DefaultSentinelManager(dcMetaCache, getXpipeNettyClientKeyedObjectPool());
    executionLog = new ExecutionLog(currentTestName());
    redisMaster = new RedisMeta().setIp("127.0.0.1").setPort(port);
    when(dcMetaCache.getSentinelMonitorName(getClusterId(), getShardId())).thenReturn(sentinelMonitorName);
    when(dcMetaCache.getSentinel(getClusterId(), getShardId())).thenReturn(new SentinelMeta().setAddress(allSentinels));
}
Also used : ExecutionLog(com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog) SentinelMeta(com.ctrip.xpipe.redis.core.entity.SentinelMeta) RedisMeta(com.ctrip.xpipe.redis.core.entity.RedisMeta) DefaultSentinelManager(com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultSentinelManager) Before(org.junit.Before)

Aggregations

RedisMeta (com.ctrip.xpipe.redis.core.entity.RedisMeta)1 SentinelMeta (com.ctrip.xpipe.redis.core.entity.SentinelMeta)1 ExecutionLog (com.ctrip.xpipe.redis.meta.server.dcchange.ExecutionLog)1 DefaultSentinelManager (com.ctrip.xpipe.redis.meta.server.dcchange.impl.DefaultSentinelManager)1 Before (org.junit.Before)1