use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testExecParser.
@Test
public void testExecParser() {
String command = "exec";
KVEntry builder = new ExecParser().parse(parseCommand(command));
Assert.assertEquals("exec", builder.getCommand());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testRenameParser.
@Test
public void testRenameParser() {
String command = "RENAME key newkey";
KVEntry builder = new RenameParser().parse(parseCommand(command));
Assert.assertEquals("RENAME", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("newkey", builder.getValue());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testSetParser2.
@Test
public void testSetParser2() {
String command = "set key value EX 100";
KVEntry builder = new SetParser().parse(parseCommand(command));
Assert.assertEquals("set", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
Assert.assertTrue(100 == builder.getParam(Options.REDIS_EX));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testZRemRangeByLexParser.
@Test
public void testZRemRangeByLexParser() {
String command = "ZRemRangeByLex key 0 10";
KVEntry builder = new ZRemRangeByLexParser().parse(parseCommand(command));
Assert.assertEquals("ZRemRangeByLex", 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 testLTrimParser.
@Test
public void testLTrimParser() {
String command = "LTrim key 0 -1";
KVEntry builder = new LTrimParser().parse(parseCommand(command));
Assert.assertEquals("LTrim", 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("-1", res.get(1));
}
Aggregations