use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.
the class ProcessorTest method getProcessor.
private RedisEventProcessor getProcessor(Config config) {
RedisEventHandler eventHandler = new DefaultRedisEventHandler(config);
RedisEventProcessor processor = new DefaultRedisEventProcessor(config);
processor.registEventHandler(eventHandler);
return processor;
}
use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.
the class ListenerTest method getExceptionProcessor.
private RedisEventProcessor getExceptionProcessor(Config config) {
RedisEventHandler eventHandler = new DefaultRedisEventHandler(config);
RedisEventProcessor processor = mock(DefaultRedisEventProcessor.class);
processor.registEventHandler(eventHandler);
try {
when(processor.commit(any())).thenThrow(new IllegalStateException("wrong number."));
} catch (Exception e) {
e.printStackTrace();
}
return processor;
}
use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.
the class ProcessorTest method testSyncMod.
@Test
public void testSyncMod() throws IOException {
RedisEventProcessor processor = null;
try {
processor = getProcessor(SyncMod.LAST_OFFSET_FORCE);
processor.start();
processor = getProcessor(SyncMod.CUSTOM_OFFSET_FORCE);
processor.start();
processor = getProcessor(SyncMod.LAST_OFFSET);
processor.start();
processor = getProcessor(SyncMod.CUSTOM_OFFSET);
processor.start();
} catch (JedisConnectionException e) {
}
}
Aggregations