use of com.moilioncircle.redis.replicator.cmd.impl.GetSetCommand in project rocketmq-externals by apache.
the class RedisEventHandlerTest method testNull.
@Test
public void testNull() {
Config config = getConfig();
RedisEventHandler handler = new DefaultRedisEventHandler(config);
KVEntry res = null;
Exception ex = null;
// 测试increment下的rdb数据处理
config.setSyncMod(SyncMod.LAST_OFFSET.name());
KeyValuePair keyValuePair = new KeyStringValueString();
keyValuePair.setKey("key".getBytes());
keyValuePair.setValue("value".getBytes());
try {
res = handler.handleKVString(replId, offset, keyValuePair);
} catch (Exception e) {
e.printStackTrace();
ex = e;
}
Assert.assertNull(res);
Assert.assertNull(ex);
// 测试未指定的command
GetSetCommand command = new GetSetCommand();
command.setKey("key".getBytes());
command.setValue("value".getBytes());
try {
res = handler.handleCommand(replId, offset, command);
} catch (Exception e) {
ex = e;
}
Assert.assertNull(res);
Assert.assertNull(ex);
}
Aggregations