Search in sources :

Example 6 with SentinelMeta

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

the class DefaultSentinelMonitorsCheckTest method checkSentinel.

@Test
public void checkSentinel() throws Exception {
    when(metaCache.findClusterShardBySentinelMonitor(any())).thenReturn(null);
    checker.checkSentinel(new SentinelMeta().setAddress("127.0.0.1:5000,127.0.0.1:5001,127.0.0.1:5002"), new HostPort("127.0.0.1", 5000));
    verify(alertManager, atLeastOnce()).alert(eq(null), eq(null), eq(null), eq(ALERT_TYPE.SENTINEL_MONITOR_INCONSIS), anyString());
    verify(sentinelManager, atLeastOnce()).removeSentinelMonitor(any(), any());
}
Also used : SentinelMeta(com.ctrip.xpipe.redis.core.entity.SentinelMeta) HostPort(com.ctrip.xpipe.endpoint.HostPort) Test(org.junit.Test)

Example 7 with SentinelMeta

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

the class DefaultSentinelMonitorsCheckTest method checkSentinel2.

@Test
public void checkSentinel2() throws Exception {
    when(metaCache.findClusterShardBySentinelMonitor(any())).thenReturn(new Pair<>("cluster", "shard"));
    checker.checkSentinel(new SentinelMeta().setAddress("127.0.0.1:5000,127.0.0.1:5001,127.0.0.1:5002"), new HostPort("127.0.0.1", 5000));
    verify(alertManager, never()).alert(eq(null), eq(null), eq(null), eq(ALERT_TYPE.SENTINEL_MONITOR_INCONSIS), anyString());
    verify(sentinelManager, never()).removeSentinelMonitor(any(), any());
}
Also used : SentinelMeta(com.ctrip.xpipe.redis.core.entity.SentinelMeta) HostPort(com.ctrip.xpipe.endpoint.HostPort) Test(org.junit.Test)

Aggregations

SentinelMeta (com.ctrip.xpipe.redis.core.entity.SentinelMeta)7 Test (org.junit.Test)4 HostPort (com.ctrip.xpipe.endpoint.HostPort)3 AbstractConsoleTest (com.ctrip.xpipe.redis.console.AbstractConsoleTest)1 AbstractRedisTest (com.ctrip.xpipe.redis.core.AbstractRedisTest)1 DcMeta (com.ctrip.xpipe.redis.core.entity.DcMeta)1 RedisMeta (com.ctrip.xpipe.redis.core.entity.RedisMeta)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