First complete version of Kafka flowlet

Quick links:

README: https://github.com/caskdata/cdap-packs/blob/feature/kafka/cdap-kafka-pack/cdap-kafka-flow/README.md

BUILD: https://github.com/caskdata/cdap-packs/blob/feature/kafka/cdap-kafka-pack/cdap-kafka-flow/BUILD.md
That's the draw back the test API that we can only ask for at least x events. Hence I asked for 5 above, then ask for 6 and expect failure



Sent from my iPhone

> On Nov 6, 2014, at 7:22 PM, Gokul <notifications@github.com> wrote:
> 
> In cdap-kafka-pack/cdap-kafka-flow/cdap-kafka-flow-core/src/test/java/co/cask/cdap/kafka/flow/KafkaConsumerFlowletTestBase.java:
> 
> > +    // Publish 5 messages to Kafka, the flow should consume them
> > +    int msgCount = 5;
> > +    Map<String, String> messages = Maps.newHashMap();
> > +    for (int i = 0; i < msgCount; i++) {
> > +      messages.put(Integer.toString(i), "Message " + i);
> > +    }
> > +    sendMessage(topic, messages);
> > +
> > +    RuntimeMetrics sinkMetrics = RuntimeStats.getFlowletMetrics("KafkaConsumingApp", "KafkaConsumingFlow", "DataSink");
> > +    sinkMetrics.waitForProcessed(msgCount, 10, TimeUnit.SECONDS);
> > +    try {
> > +      // Wait for 6 messages. This should get a TimeoutException, as there is only 5 messages
> > +      sinkMetrics.waitForProcessed(msgCount + 1, 2, TimeUnit.SECONDS);
> > +      Assert.fail("Expected 5 message, but got at least 6");
> > +    } catch (TimeoutException e) {
> > +      // Expected
> Here, should we make sure we got exactly 5 messages?
> 
> —
> Reply to this email directly or view it on GitHub.
>