use of org.apache.rocketmq.connect.redis.parser.SetParser in project rocketmq-externals by apache.
the class ParserTest method testSetParser1.
@Test
public void testSetParser1() {
String command = "set key value EX 100 NX";
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));
Assert.assertEquals(true, builder.getParam(Options.REDIS_NX));
}
use of org.apache.rocketmq.connect.redis.parser.SetParser 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.parser.SetParser in project rocketmq-externals by apache.
the class ParserTest method testSetParser4.
@Test
public void testSetParser4() {
String command = "set key value PX 100 XX";
KVEntry builder = new SetParser().parse(parseCommand(command));
Assert.assertEquals("set", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
Assert.assertTrue(100L == builder.getParam(Options.REDIS_PX));
Assert.assertEquals(true, builder.getParam(Options.REDIS_XX));
}
use of org.apache.rocketmq.connect.redis.parser.SetParser in project rocketmq-externals by apache.
the class ParserTest method testSetParser3.
@Test
public void testSetParser3() {
String command = "set key value NX";
KVEntry builder = new SetParser().parse(parseCommand(command));
Assert.assertEquals("set", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
Assert.assertEquals(true, builder.getParam(Options.REDIS_NX));
}
Aggregations