use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testSAddParser.
@Test
public void testSAddParser() {
String command = "SADD key m1 m2";
KVEntry builder = new SAddParser().parse(parseCommand(command));
Assert.assertEquals("SADD", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("m1", res.get(0));
Assert.assertEquals("m2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testLRemParser.
@Test
public void testLRemParser() {
String command = "LRem key 100 value";
KVEntry builder = new LRemParser().parse(parseCommand(command));
Assert.assertEquals("LRem", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
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 testMoveParser.
@Test
public void testMoveParser() {
String command = "move key 1";
KVEntry builder = new MoveParser().parse(parseCommand(command));
Assert.assertEquals("move", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertTrue(1 == builder.getParam(Options.REDIS_DB_INDEX));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testSortParser.
@Test
public void testSortParser() {
String command = "sort key";
KVEntry builder = new SortParser().parse(parseCommand(command));
Assert.assertEquals("sort", 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 testIncrParser.
@Test
public void testIncrParser() {
String command = "INCR key";
KVEntry builder = new IncrParser().parse(parseCommand(command));
Assert.assertEquals("INCR", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
}
Aggregations