use of org.redisson.codec.MsgPackJacksonCodec in project redisson by redisson.
the class RedissonMapCacheTest method testContainsValue.
@Test
public void testContainsValue() throws InterruptedException {
RMapCache<SimpleKey, SimpleValue> map = redisson.getMapCache("simple01", new MsgPackJacksonCodec());
Assert.assertFalse(map.containsValue(new SimpleValue("34")));
map.put(new SimpleKey("33"), new SimpleValue("44"), 1, TimeUnit.SECONDS);
Assert.assertTrue(map.containsValue(new SimpleValue("44")));
Assert.assertFalse(map.containsValue(new SimpleValue("34")));
Thread.sleep(1000);
Assert.assertFalse(map.containsValue(new SimpleValue("44")));
}
use of org.redisson.codec.MsgPackJacksonCodec in project redisson by redisson.
the class RedissonSetCacheReactiveTest method testScheduler.
@Test
public void testScheduler() throws InterruptedException {
RSetCacheReactive<String> cache = redisson.getSetCache("simple33", new MsgPackJacksonCodec());
Assert.assertFalse(sync(cache.contains("33")));
Assert.assertTrue(sync(cache.add("33", 5, TimeUnit.SECONDS)));
Thread.sleep(11000);
Assert.assertEquals(0, sync(cache.size()).intValue());
}
use of org.redisson.codec.MsgPackJacksonCodec in project redisson by redisson.
the class RedissonSetCacheTest method testScheduler.
@Test
public void testScheduler() throws InterruptedException {
RSetCache<String> cache = redisson.getSetCache("simple33", new MsgPackJacksonCodec());
Assert.assertFalse(cache.contains("33"));
Assert.assertTrue(cache.add("33", 5, TimeUnit.SECONDS));
Thread.sleep(11000);
Assert.assertEquals(0, cache.size());
}
use of org.redisson.codec.MsgPackJacksonCodec in project redisson by redisson.
the class RedissonMapCacheReactiveTest method testScheduler.
@Test
public void testScheduler() throws InterruptedException {
RMapCacheReactive<SimpleKey, SimpleValue> map = redisson.getMapCache("simple", new MsgPackJacksonCodec());
Assert.assertNull(sync(map.get(new SimpleKey("33"))));
sync(map.put(new SimpleKey("33"), new SimpleValue("44"), 5, TimeUnit.SECONDS));
Thread.sleep(11000);
Assert.assertEquals(0, sync(map.size()).intValue());
}
use of org.redisson.codec.MsgPackJacksonCodec in project redisson by redisson.
the class RedissonMapCacheReactiveTest method testPutGet.
@Test
public void testPutGet() throws InterruptedException {
RMapCacheReactive<SimpleKey, SimpleValue> map = redisson.getMapCache("simple01", new MsgPackJacksonCodec());
Assert.assertNull(sync(map.get(new SimpleKey("33"))));
sync(map.put(new SimpleKey("33"), new SimpleValue("44"), 2, TimeUnit.SECONDS));
SimpleValue val1 = sync(map.get(new SimpleKey("33")));
Assert.assertEquals("44", val1.getValue());
Thread.sleep(1000);
Assert.assertEquals(1, sync(map.size()).intValue());
SimpleValue val2 = sync(map.get(new SimpleKey("33")));
Assert.assertEquals("44", val2.getValue());
Assert.assertEquals(1, sync(map.size()).intValue());
Thread.sleep(1000);
Assert.assertNull(sync(map.get(new SimpleKey("33"))));
}
Aggregations