context.put("compression-level", Integer.toString(6));
Configurables.configure(sink, context);
sink.start();
Transaction sickTransaction = channel.getTransaction();
sickTransaction.begin();
for (int i = 0; i < 10; i++) {
channel.put(event);
}
sickTransaction.commit();
sickTransaction.close();
for (int i = 0; i < 5; i++) {
Sink.Status status = sink.process();
logger.debug("Calling Process " + i + " times:" + status);
Assert.assertEquals(Sink.Status.READY, status);
}
sink.stop();
Transaction sourceTransaction = sourceChannel.getTransaction();
sourceTransaction.begin();
Event sourceEvent = sourceChannel.take();
Assert.assertNotNull(sourceEvent);
Assert.assertEquals("Channel contained our event", "Hello avro",
new String(sourceEvent.getBody()));
sourceTransaction.commit();
sourceTransaction.close();
logger.debug("Round trip event:{}", sourceEvent);
source.stop();
Assert.assertTrue("Reached stop or error",