Search in sources :

Example 1 with XTrimParser

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

the class ParserTest method testXTrimParser2.

@Test
public void testXTrimParser2() {
    String command = "XTrim key MAXLEN 100";
    KVEntry builder = new XTrimParser().parse(parseCommand(command));
    Assert.assertEquals("XTrim", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Assert.assertEquals(false, builder.getParam(Options.REDIS_XTRIM));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) XTrimParser(org.apache.rocketmq.connect.redis.parser.XTrimParser) Test(org.junit.Test)

Example 2 with XTrimParser

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

the class ParserTest method testXTrimParser.

@Test
public void testXTrimParser() {
    String command = "XTrim key MAXLEN ~ 100";
    KVEntry builder = new XTrimParser().parse(parseCommand(command));
    Assert.assertEquals("XTrim", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Assert.assertEquals(true, builder.getParam(Options.REDIS_XTRIM));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) XTrimParser(org.apache.rocketmq.connect.redis.parser.XTrimParser) Test(org.junit.Test)

Aggregations

XTrimParser (org.apache.rocketmq.connect.redis.parser.XTrimParser)2 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)2 Test (org.junit.Test)2