use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testXAckParser.
@Test
public void testXAckParser() {
String command = "XAck key group 1526569498055-0 1526569498055-1";
KVEntry builder = new XAckParser().parse(parseCommand(command));
Assert.assertEquals("XAck", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("group", builder.getParam(Options.REDIS_GROUP));
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("1526569498055-0", res.get(0));
Assert.assertEquals("1526569498055-1", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testZRemRangeByScoreParser.
@Test
public void testZRemRangeByScoreParser() {
String command = "ZREMRANGEBYSCORE key 0 10";
KVEntry builder = new ZRemRangeByScoreParser().parse(parseCommand(command));
Assert.assertEquals("ZREMRANGEBYSCORE", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("0", res.get(0));
Assert.assertEquals("10", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testRPopParser.
@Test
public void testRPopParser() {
String command = "RPOP key";
KVEntry builder = new RPopParser().parse(parseCommand(command));
Assert.assertEquals("RPOP", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testLPushXParser.
@Test
public void testLPushXParser() {
String command = "LPUSHX key value";
KVEntry builder = new LPushXParser().parse(parseCommand(command));
Assert.assertEquals("LPUSHX", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testFlushDbParser.
@Test
public void testFlushDbParser() {
String command = "FLUSHDB ASYNC";
KVEntry builder = new FlushDbParser().parse(parseCommand(command));
Assert.assertEquals("FLUSHDB", builder.getCommand());
Assert.assertEquals("ASYNC", builder.getKey());
}
Aggregations