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-2422: Sqoop2: Test TestJSONIntermediateDataFormat is failing on JDK8
Date Thu, 23 Jul 2015 04:03:22 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 4d2db87b3 -> 473de8932


SQOOP-2422: Sqoop2: Test TestJSONIntermediateDataFormat is failing on JDK8

(Jarek Jarcec Cecho 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/473de893
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/473de893
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/473de893

Branch: refs/heads/sqoop2
Commit: 473de893246a3ee0087ad42a306d3dd715152c29
Parents: 4d2db87
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Jul 22 16:21:52 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Jul 22 21:03:03 2015 -0700

----------------------------------------------------------------------
 .../sqoop/connector/idf/TestJSONIntermediateDataFormat.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/473de893/connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestJSONIntermediateDataFormat.java
----------------------------------------------------------------------
diff --git a/connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestJSONIntermediateDataFormat.java
b/connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestJSONIntermediateDataFormat.java
index e2768e2..bcc1f95 100644
--- a/connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestJSONIntermediateDataFormat.java
+++ b/connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestJSONIntermediateDataFormat.java
@@ -26,6 +26,7 @@ import static org.testng.Assert.assertEquals;
 import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.common.SqoopIDFUtils;
+import org.apache.sqoop.json.JSONUtils;
 import org.apache.sqoop.schema.Schema;
 import org.apache.sqoop.schema.type.Array;
 import org.apache.sqoop.schema.type.Binary;
@@ -90,9 +91,12 @@ public class TestJSONIntermediateDataFormat {
         + "','ENUM'," + csvArray + "," + map + ",true," + dateTime + "," + time + "," + date
         + ",13.44," + csvSet;
     dataFormat.setCSVTextData(csvText);
-    String jsonExpected = "{\"15\":[[11,12],[14,15]],\"13\":\"2014-10-01\",\"14\":13.44,\"11\":\"2014-10-01
12:00:00.000\","
+    // Different JDK version will have different order of the key/value pars as that is technically
undefined
+    // Hence we're parsing the expected string and then serializing it back to string to
get the JVM expected
+    // order. Future enhancement would be to provide assertJson().
+    String jsonExpected = JSONUtils.parse("{\"15\":[[11,12],[14,15]],\"13\":\"2014-10-01\",\"14\":13.44,\"11\":\"2014-10-01
12:00:00.000\","
         + "\"12\":\"12:59:59\",\"3\":\"54\",\"2\":34,\"1\":10,\"10\":true,\"7\":\"ENUM\",\"6\":\"10\",\"5\":\"kDY=\",\"4\":\"random
data\","
-        + "\"9\":{\"testKey\":\"testValue\"},\"8\":[[11,11],[14,15]]}";
+        + "\"9\":{\"testKey\":\"testValue\"},\"8\":[[11,11],[14,15]]}").toJSONString();
     assertEquals(jsonExpected, dataFormat.getData().toJSONString());
   }
 


Mime
View raw message