use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testClusterConfig.
@Test
public void testClusterConfig() throws IOException {
Config originalConfig = new Config();
originalConfig.useClusterServers().addNodeAddress("123.123.1.23:1902", "9.3.1.0:1902");
String t = originalConfig.toJSON();
Config c = Config.fromJSON(t);
System.out.println(t);
assertThat(c.toJSON()).isEqualTo(t);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonTest method testSingleConfigJSON.
@Test
public void testSingleConfigJSON() throws IOException {
RedissonClient r = BaseTest.createInstance();
String t = r.getConfig().toJSON();
Config c = Config.fromJSON(t);
assertThat(c.toJSON()).isEqualTo(t);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonScheduledExecutorServiceTest method beforeClass.
@BeforeClass
public static void beforeClass() throws IOException, InterruptedException {
if (!RedissonRuntimeEnvironment.isTravis) {
BaseTest.beforeClass();
Config config = createConfig();
RedissonNodeConfig nodeConfig = new RedissonNodeConfig(config);
nodeConfig.setExecutorServiceWorkers(Collections.singletonMap("test", 1));
node = RedissonNode.create(nodeConfig);
node.start();
}
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonCodecTest method testMsgPack.
@Test
public void testMsgPack() {
Config config = createConfig();
config.setCodec(msgPackCodec);
RedissonClient redisson = Redisson.create(config);
test(redisson);
}
use of org.redisson.config.Config in project redisson by redisson.
the class RedissonMapTest method testStringCodec.
@Test
public void testStringCodec() {
Config config = createConfig();
config.setCodec(StringCodec.INSTANCE);
RedissonClient redisson = Redisson.create(config);
RMap<String, String> rmap = redisson.getMap("TestRMap01");
rmap.put("A", "1");
rmap.put("B", "2");
Iterator<Map.Entry<String, String>> iterator = rmap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, String> next = iterator.next();
assertThat(next).isIn(new AbstractMap.SimpleEntry("A", "1"), new AbstractMap.SimpleEntry("B", "2"));
}
redisson.shutdown();
}
Aggregations