use of com.lambdaworks.redis.RedisURI in project jetcache by alibaba.
the class RedisLutteceCacheTest method testCluster.
@Test
public void testCluster() throws Exception {
if (!checkOS()) {
return;
}
RedisURI node1 = RedisURI.create("127.0.0.1", 7000);
RedisURI node2 = RedisURI.create("127.0.0.1", 7001);
RedisURI node3 = RedisURI.create("127.0.0.1", 7002);
RedisClusterClient client = RedisClusterClient.create(Arrays.asList(node1, node2, node3));
test(client);
}
use of com.lambdaworks.redis.RedisURI in project jetcache by alibaba.
the class LutteceConnectionManagerTest method testCluster.
@Test
public void testCluster() {
if (!RedisLutteceCacheTest.checkOS()) {
return;
}
RedisURI node1 = RedisURI.create("127.0.0.1", 7000);
RedisURI node2 = RedisURI.create("127.0.0.1", 7001);
RedisURI node3 = RedisURI.create("127.0.0.1", 7002);
RedisClusterClient client = RedisClusterClient.create(Arrays.asList(node1, node2, node3));
LutteceConnectionManager m = LutteceConnectionManager.defaultManager();
Assert.assertSame(m.commands(client), m.commands(client));
Assert.assertSame(m.asyncCommands(client), m.asyncCommands(client));
Assert.assertSame(m.reactiveCommands(client), m.reactiveCommands(client));
m.removeAndClose(client);
}
use of com.lambdaworks.redis.RedisURI in project jetcache by alibaba.
the class RedisLutteceCacheTest method testSentinel.
@Test
public void testSentinel() throws Exception {
RedisURI redisUri = RedisURI.Builder.sentinel("127.0.0.1", 26379, "mymaster").withSentinel("127.0.0.1", 26380).withSentinel("127.0.0.1", 26381).build();
RedisClient client = RedisClient.create(redisUri);
test(client);
}
Aggregations