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-2492: Sqoop2: getNestedProperties() in MapContext puts key instead of value
Date Fri, 14 Aug 2015 22:25:28 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 796c752c1 -> bb7c350d5


SQOOP-2492: Sqoop2: getNestedProperties() in MapContext puts key instead of value

(Banmeet Singh 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/bb7c350d
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/bb7c350d
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/bb7c350d

Branch: refs/heads/sqoop2
Commit: bb7c350d55903f76d441a0950f5237fcfa29f903
Parents: 796c752
Author: Abraham Elmahrek <abe@apache.org>
Authored: Fri Aug 14 15:24:58 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Fri Aug 14 15:24:58 2015 -0700

----------------------------------------------------------------------
 common/src/main/java/org/apache/sqoop/common/MapContext.java  | 2 +-
 .../src/test/java/org/apache/sqoop/common/TestMapContext.java | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/bb7c350d/common/src/main/java/org/apache/sqoop/common/MapContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/common/MapContext.java b/common/src/main/java/org/apache/sqoop/common/MapContext.java
index a0cc660..fc722c0 100644
--- a/common/src/main/java/org/apache/sqoop/common/MapContext.java
+++ b/common/src/main/java/org/apache/sqoop/common/MapContext.java
@@ -112,7 +112,7 @@ public class MapContext implements ImmutableContext {
     Map<String, String> subProps = new HashMap<String, String>();
     for(Map.Entry<String, String> entry : options.entrySet()) {
       if(entry.getKey().startsWith(prefix)) {
-        subProps.put(entry.getKey().substring(prefix.length()), entry.getKey());
+        subProps.put(entry.getKey().substring(prefix.length()), entry.getValue());
       }
     }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/bb7c350d/common/src/test/java/org/apache/sqoop/common/TestMapContext.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/common/TestMapContext.java b/common/src/test/java/org/apache/sqoop/common/TestMapContext.java
index 0bd6a3b..2a27c0c 100644
--- a/common/src/test/java/org/apache/sqoop/common/TestMapContext.java
+++ b/common/src/test/java/org/apache/sqoop/common/TestMapContext.java
@@ -97,15 +97,16 @@ public class TestMapContext {
   @Test
   public void testGetNestedProperties() {
     Map<String, String> options = new HashMap<String, String>();
-    options.put("sqooptest1", "value");
-    options.put("sqooptest2", "value");
-    options.put("testsqoop1", "value");
+    options.put("sqooptest1", "value1");
+    options.put("sqooptest2", "value2");
     options.put("testsqoop1", "value");
     MapContext mc = new MapContext(options);
     Map<String, String> result = mc.getNestedProperties("sqoop");
     Assert.assertEquals(2, result.size());
     Assert.assertTrue(result.containsKey("test1"));
     Assert.assertTrue(result.containsKey("test2"));
+    Assert.assertEquals(result.get("test1"), "value1");
+    Assert.assertEquals(result.get("test2"), "value2");
     Assert.assertFalse(result.containsKey("testsqoop1"));
     Assert.assertFalse(result.containsKey("testsqoop2"));
   }


Mime
View raw message