kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-4660; Improve test coverage KafkaStreams
Date Fri, 26 May 2017 22:32:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 68eed84f2 -> ca8915d2e


KAFKA-4660; Improve test coverage KafkaStreams

dguy , mjsax Please review the PR and let me know your comments.

Author: umesh chaudhary <umesh9794@gmail.com>

Reviewers: Bill Bejeck, Matthias J. Sax, Guozhang Wang

Closes #3099 from umesh9794/mylocal


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/ca8915d2
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/ca8915d2
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/ca8915d2

Branch: refs/heads/trunk
Commit: ca8915d2efc225dbc0a4c138a2a34cf34d07e347
Parents: 68eed84
Author: Umesh Chaudhary <umesh9794@gmail.com>
Authored: Fri May 26 15:31:58 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri May 26 15:31:58 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/kafka/streams/KafkaStreamsTest.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ca8915d2/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java b/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
index efa484e..4ebc42b 100644
--- a/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java
@@ -289,6 +289,18 @@ public class KafkaStreamsTest {
         }
     }
 
+    @Test
+    public void testToString() {
+        streams.start();
+        String streamString = streams.toString();
+        streams.close();
+        String appId = streamString.split("\\n")[1].split(":")[1].trim();
+        Assert.assertNotEquals("streamString should not be empty", "", streamString);
+        Assert.assertNotNull("streamString should not be null", streamString);
+        Assert.assertNotEquals("streamString contains non-empty appId", "", appId);
+        Assert.assertNotNull("streamString contains non-null appId", appId);
+    }
+
 
     public static class StateListenerStub implements KafkaStreams.StateListener {
         public int numChanges = 0;


Mime
View raw message