sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2169: Sqoop2: Kafka integration test bug
Date Tue, 17 Mar 2015 03:06:18 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 b1dcdcbe2 -> 1abf38d63


SQOOP-2169: Sqoop2: Kafka integration test bug

(Gwen Shapira via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: 1abf38d631e5841393706d4619fe69e0854d505d
Parents: b1dcdcb
Author: Abraham Elmahrek <abe@apache.org>
Authored: Mon Mar 16 20:05:31 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Mon Mar 16 20:05:31 2015 -0700

----------------------------------------------------------------------
 .../sqoop/test/testcases/KafkaConnectorTestCase.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/1abf38d6/test/src/main/java/org/apache/sqoop/test/testcases/KafkaConnectorTestCase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/testcases/KafkaConnectorTestCase.java
b/test/src/main/java/org/apache/sqoop/test/testcases/KafkaConnectorTestCase.java
index a65d862..b1bfb36 100644
--- a/test/src/main/java/org/apache/sqoop/test/testcases/KafkaConnectorTestCase.java
+++ b/test/src/main/java/org/apache/sqoop/test/testcases/KafkaConnectorTestCase.java
@@ -31,6 +31,9 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Arrays;
 
 import static org.apache.sqoop.connector.common.SqoopIDFUtils.toText;
 
@@ -70,11 +73,16 @@ public class KafkaConnectorTestCase extends ConnectorTestCase {
    * @throws UnsupportedEncodingException
    */
   protected void validateContent(String[] content) throws UnsupportedEncodingException {
+
+    Set<String> inputSet = new HashSet<String>(Arrays.asList(content));
+    Set<String> outputSet = new HashSet<String>();
+
     for(String str: content) {
       MessageAndMetadata<byte[],byte[]> fetchedMsg =
               testUtil.getNextMessageFromConsumer(TOPIC);
-      Assert.assertEquals(str,
-              toText(new String(fetchedMsg.message(), "UTF-8")));
+      outputSet.add(toText(new String(fetchedMsg.message(), "UTF-8")));
     }
+
+    Assert.assertEquals(inputSet, outputSet);
   }
 }


Mime
View raw message