use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testElasticacheConnectionFail.
@Test(expected = RedisConnectionException.class)
public void testElasticacheConnectionFail() throws InterruptedException {
Config config = new Config();
config.useElasticacheServers().addNodeAddress("127.99.0.1:1111");
Redisson.create(config);
Thread.sleep(1500);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testClusterConnectionFail.
@Test(expected = RedisConnectionException.class)
public void testClusterConnectionFail() throws InterruptedException {
Config config = new Config();
config.useClusterServers().addNodeAddress("127.99.0.1:1111");
Redisson.create(config);
Thread.sleep(1500);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testSingleConfigYAML.
@Test
public void testSingleConfigYAML() throws IOException {
RedissonClient r = BaseTest.createInstance();
String t = r.getConfig().toYAML();
Config c = Config.fromYAML(t);
assertThat(c.toYAML()).isEqualTo(t);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testMasterSlaveConfigJSON.
@Test
public void testMasterSlaveConfigJSON() throws IOException {
Config c2 = new Config();
c2.useMasterSlaveServers().setMasterAddress("123.1.1.1:1231").addSlaveAddress("82.12.47.12:1028");
String t = c2.toJSON();
Config c = Config.fromJSON(t);
assertThat(c.toJSON()).isEqualTo(t);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testMemoryCommand.
@Test(expected = RedisOutOfMemoryException.class)
public void testMemoryCommand() throws IOException, InterruptedException {
RedisProcess p = redisTestSmallMemory();
Config config = new Config();
config.useSingleServer().setAddress(p.getRedisServerAddressAndPort()).setTimeout(100000);
RedissonClient r = null;
try {
r = Redisson.create(config);
r.getKeys().flushall();
for (int i = 0; i < 10000; i++) {
r.getMap("test").fastPut("" + i, "" + i);
}
} finally {
r.shutdown();
p.stop();
}
}
Aggregations