use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testZPopMaxParser.
@Test
public void testZPopMaxParser() {
String command = "ZPOPMAX key 100";
KVEntry builder = new ZPopMaxParser().parse(parseCommand(command));
Assert.assertEquals("ZPOPMAX", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertTrue(100L == builder.getParam(Options.REDIS_COUNT));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testLPushParser.
@Test
public void testLPushParser() {
String command = "LPUSH key v1 v2";
KVEntry builder = new LPushParser().parse(parseCommand(command));
Assert.assertEquals("LPUSH", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("v1", res.get(0));
Assert.assertEquals("v2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testXSetIdParser.
@Test
public void testXSetIdParser() {
String command = "XSetId key arg";
KVEntry builder = new XSetIdParser().parse(parseCommand(command));
Assert.assertEquals("XSetId", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("arg", builder.getValue());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testRPushParser.
@Test
public void testRPushParser() {
String command = "RPUSH key v1 v2";
KVEntry builder = new RPushParser().parse(parseCommand(command));
Assert.assertEquals("RPUSH", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("v1", res.get(0));
Assert.assertEquals("v2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testXDelParser.
@Test
public void testXDelParser() {
String command = "XDel key 1526569498055-0 1526569498055-1";
KVEntry builder = new XDelParser().parse(parseCommand(command));
Assert.assertEquals("XDel", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
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));
}
Aggregations