Search in sources :

Example 1 with DelParser

use of org.apache.rocketmq.connect.redis.parser.DelParser in project rocketmq-externals by apache.

the class ParserTest method testDelParser.

@Test
public void testDelParser() {
    String command = "del k1 k2 k3";
    KVEntry builder = new DelParser().parse(parseCommand(command));
    Assert.assertEquals("del", builder.getCommand());
    Assert.assertEquals("k1", builder.getKey());
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(3, res.size());
    Assert.assertEquals("k1", res.get(0));
    Assert.assertEquals("k2", res.get(1));
    Assert.assertEquals("k3", res.get(2));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) List(java.util.List) XDelParser(org.apache.rocketmq.connect.redis.parser.XDelParser) HDelParser(org.apache.rocketmq.connect.redis.parser.HDelParser) DelParser(org.apache.rocketmq.connect.redis.parser.DelParser) Test(org.junit.Test)

Aggregations

List (java.util.List)1 DelParser (org.apache.rocketmq.connect.redis.parser.DelParser)1 HDelParser (org.apache.rocketmq.connect.redis.parser.HDelParser)1 XDelParser (org.apache.rocketmq.connect.redis.parser.XDelParser)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1 Test (org.junit.Test)1