use of org.apache.rocketmq.connect.redis.pojo.RedisEvent in project rocketmq-externals by apache.
the class RedisSourceTaskTest method testTask.
@Test
public void testTask() throws Exception {
if (this.task != null) {
RedisEvent redisEvent = getRedisEvent();
this.task.getEventProcessor().commit(redisEvent);
Collection<SourceDataEntry> col = this.task.poll();
Assert.assertNotNull(col);
Assert.assertEquals(1, col.size());
Assert.assertNotNull(this.task.getConfig());
}
}
use of org.apache.rocketmq.connect.redis.pojo.RedisEvent in project rocketmq-externals by apache.
the class ProcessorTest method test.
@Test
public void test() {
processor = getProcessor();
RedisEvent event = getRedisEvent();
Exception ex = null;
try {
processor.commit(event);
} catch (Exception e) {
e.printStackTrace();
ex = e;
}
Assert.assertNull(ex);
try {
KVEntry entry = processor.poll();
Assert.assertEquals("key", entry.getKey());
Assert.assertEquals("value", entry.getValue());
Assert.assertEquals("c18cece63c7b16851a6f387f52dbbb9eee07e46f", entry.getSourceId());
} catch (InterruptedException e) {
e.printStackTrace();
ex = e;
} catch (Exception e) {
e.printStackTrace();
}
Assert.assertNull(ex);
}
Aggregations