use of com.moilioncircle.redis.replicator.rdb.datatype.ZSetEntry in project rocketmq-externals by apache.
the class RedisEventHandlerTest method testZSet2.
@Test
public void testZSet2() {
KVEntry builder = handlerTest(RDB_TYPE_ZSET_2, () -> {
Set<ZSetEntry> values = new HashSet<>();
values.add(new ZSetEntry("key1".getBytes(), 100));
values.add(new ZSetEntry("key2".getBytes(), 80));
return values;
});
Map<String, Double> va = (Map<String, Double>) builder.getValue();
Assert.assertNotNull(va);
Assert.assertEquals(2, va.size());
Assert.assertTrue(100 == va.get("key1"));
Assert.assertTrue(80 == va.get("key2"));
}
use of com.moilioncircle.redis.replicator.rdb.datatype.ZSetEntry in project rocketmq-externals by apache.
the class RedisEventHandlerTest method testZSetZipList.
@Test
public void testZSetZipList() {
KVEntry builder = handlerTest(RDB_TYPE_ZSET_ZIPLIST, () -> {
Set<ZSetEntry> values = new HashSet<>();
values.add(new ZSetEntry("v1".getBytes(), 100));
values.add(new ZSetEntry("v2".getBytes(), 80));
return values;
});
Map<String, Double> va = (Map<String, Double>) builder.getValue();
Assert.assertNotNull(va);
Assert.assertEquals(2, va.size());
Assert.assertTrue(100 == va.get("v1"));
Assert.assertTrue(80 == va.get("v2"));
}
use of com.moilioncircle.redis.replicator.rdb.datatype.ZSetEntry in project rocketmq-externals by apache.
the class RedisEventHandlerTest method testZSET.
@Test
public void testZSET() {
KVEntry builder = handlerTest(RDB_TYPE_ZSET, () -> {
Set<ZSetEntry> values = new HashSet<>();
values.add(new ZSetEntry("key1".getBytes(), 100));
values.add(new ZSetEntry("key2".getBytes(), 80));
return values;
});
Map<String, Double> va = (Map<String, Double>) builder.getValue();
Assert.assertNotNull(va);
Assert.assertEquals(2, va.size());
Assert.assertTrue(100 == va.get("key1"));
Assert.assertTrue(80 == va.get("key2"));
}
Aggregations