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-2078: Sqoop2: Add ParametrizedUtils.toArrayOfArrays utils method
Date Thu, 05 Feb 2015 23:21:50 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 d43dc1b0b -> 3858e364a


SQOOP-2078: Sqoop2: Add ParametrizedUtils.toArrayOfArrays utils method

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

Branch: refs/heads/sqoop2
Commit: 3858e364a9ef724bbc7c1cd9ab71c14d80f38404
Parents: d43dc1b
Author: Abraham Elmahrek <abe@apache.org>
Authored: Thu Feb 5 15:21:11 2015 -0800
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Thu Feb 5 15:21:11 2015 -0800

----------------------------------------------------------------------
 .../sqoop/test/utils/ParametrizedUtils.java      | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/3858e364/test/src/main/java/org/apache/sqoop/test/utils/ParametrizedUtils.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/utils/ParametrizedUtils.java b/test/src/main/java/org/apache/sqoop/test/utils/ParametrizedUtils.java
index 656bc34..02a7315 100644
--- a/test/src/main/java/org/apache/sqoop/test/utils/ParametrizedUtils.java
+++ b/test/src/main/java/org/apache/sqoop/test/utils/ParametrizedUtils.java
@@ -51,6 +51,25 @@ public class ParametrizedUtils {
   }
 
   /**
+   * Convert single array to array of arrays by putting each element in the source
+   * array into it's own one-item big array.
+   *
+   * This method is suitable for conversions required by Parametrized test runner.
+   *
+   * @param array Array to be converted
+   * @return Converted array
+   */
+  public static Iterable<Object []>toArrayOfArrays(Object []array) {
+    LinkedList<Object []> ret = new LinkedList<Object []>();
+
+    for(Object o : array) {
+      ret.add(toArray(o));
+    }
+
+    return ret;
+  }
+
+  /**
    * Merge two objects into array.
    *
    * This method will flatten any argument that is already an array, e.g.:


Mime
View raw message