sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkatran...@apache.org
Subject git commit: SQOOP-1140: Enable overriding username, password and database in DB2 test
Date Wed, 17 Jul 2013 17:02:12 GMT
Updated Branches:
  refs/heads/trunk 549511378 -> 5eea9d599


SQOOP-1140: Enable overriding username, password and database in DB2 test

(Jarek Jarcec Cecho via Venkat Ranganathan)


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

Branch: refs/heads/trunk
Commit: 5eea9d59970fbe34294a5ff603761c091da928ec
Parents: 5495113
Author: Venkat Ranganathan <venkat@hortonworks.com>
Authored: Wed Jul 17 10:01:30 2013 -0700
Committer: Venkat Ranganathan <venkat@hortonworks.com>
Committed: Wed Jul 17 10:01:30 2013 -0700

----------------------------------------------------------------------
 build.xml                                       | 10 ++++++++++
 .../com/cloudera/sqoop/ThirdPartyTests.java     |  4 ++++
 .../manager/DB2ManagerImportManualTest.java     | 20 +++++++++++++++-----
 3 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/5eea9d59/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index e3683f8..9396858 100644
--- a/build.xml
+++ b/build.xml
@@ -280,6 +280,11 @@
   <property name="ms.sqlserver.password"
             value="PASSWORD"/>
 
+  <property name="sqoop.test.db2.connectstring.host_url" value="jdbc:db2://db2host:50000"
/>
+  <property name="sqoop.test.db2.connectstring.database" value="SQOOP" />
+  <property name="sqoop.test.db2.connectstring.username" value="SQOOP" />
+  <property name="sqoop.test.db2.connectstring.password" value="SQOOP" />
+
 
   <condition property="windows">
     <os family="windows" />
@@ -854,6 +859,11 @@
       <sysproperty key="java.security.krb5.kdc"
                    value="${java.security.krb5.kdc}"/>
 
+      <sysproperty key="sqoop.test.db2.connectstring.host_url" value="${sqoop.test.db2.connectstring.host_url}"
/>
+      <sysproperty key="sqoop.test.db2.connectstring.database" value="${sqoop.test.db2.connectstring.database}"
/>
+      <sysproperty key="sqoop.test.db2.connectstring.username" value="${sqoop.test.db2.connectstring.username}"
/>
+      <sysproperty key="sqoop.test.db2.connectstring.password" value="${sqoop.test.db2.connectstring.password}"
/>
+
       <!-- Location of Hive logs -->
       <!--<sysproperty key="hive.log.dir"
                    value="${test.build.data}/sqoop/logs"/> -->

http://git-wip-us.apache.org/repos/asf/sqoop/blob/5eea9d59/src/test/com/cloudera/sqoop/ThirdPartyTests.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/ThirdPartyTests.java b/src/test/com/cloudera/sqoop/ThirdPartyTests.java
index b2db1b4..0a080b6 100644
--- a/src/test/com/cloudera/sqoop/ThirdPartyTests.java
+++ b/src/test/com/cloudera/sqoop/ThirdPartyTests.java
@@ -21,6 +21,7 @@ package com.cloudera.sqoop;
 import com.cloudera.sqoop.hbase.HBaseImportAddRowKeyTest;
 import com.cloudera.sqoop.hbase.HBaseImportNullTest;
 import com.cloudera.sqoop.hbase.HBaseImportTypesTest;
+import com.cloudera.sqoop.manager.DB2ManagerImportManualTest;
 import org.apache.sqoop.hcat.HCatalogExportTest;
 import org.apache.sqoop.hcat.HCatalogImportTest;
 
@@ -103,6 +104,9 @@ public final class ThirdPartyTests extends TestCase {
     suite.addTestSuite(PostgresqlImportTest.class);
     suite.addTestSuite(PostgresqlExportTest.class);
 
+    // DB2
+    suite.addTestSuite(DB2ManagerImportManualTest.class);
+
     // Hbase
     suite.addTestSuite(HBaseImportTest.class);
     suite.addTestSuite(HBaseImportAddRowKeyTest.class);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/5eea9d59/src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java b/src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java
index f6e2e8d..3d9f817 100644
--- a/src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java
+++ b/src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java
@@ -45,7 +45,7 @@ import com.cloudera.sqoop.util.FileListing;
  *
  * This uses JDBC to import data from an DB2 database into HDFS.
  *
- * Since this requires an DB2 SErver installation,
+ * Since this requires an DB2 Server installation,
  * this class is named in such a way that Sqoop's default QA process does
  * not run it. You need to run this manually with
  * -Dtestcase=DB2ManagerImportManualTest
@@ -69,15 +69,25 @@ public class DB2ManagerImportManualTest extends ImportJobTestCase {
           "sqoop.test.db2.connectstring.host_url",
           "jdbc:db2://db2host:50000");
 
-  static final String DATABASE_NAME = "SQOOP";
-  static final String DATABASE_USER = "SQOOP";
-  static final String DATABASE_PASSWORD = "PASSWORD";
+  static final String DATABASE_NAME = System.getProperty(
+          "sqoop.test.db2.connectstring.database",
+          "SQOOP");
+  static final String DATABASE_USER = System.getProperty(
+          "sqoop.test.db2.connectstring.username",
+          "SQOOP");
+  static final String DATABASE_PASSWORD = System.getProperty(
+          "sqoop.test.db2.connectstring.password",
+          "SQOOP");
   static final String TABLE_NAME = "EMPLOYEES_DB2";
-  static final String QUALIFIED_TABLE_NAME = "PREFIX.EMPLOYEES_DB2";
+  static final String QUALIFIED_TABLE_NAME = DATABASE_USER + ".EMPLOYEES_DB2";
   static final String CONNECT_STRING = HOST_URL
               + "/" + DATABASE_NAME
               + ":currentSchema=" + DATABASE_USER +";";
 
+  static {
+    LOG.info("Using DB2 CONNECT_STRING: " + CONNECT_STRING);
+  }
+
   // instance variables populated during setUp, used during tests
   private Db2Manager manager;
   private boolean useQualifiedTableName;


Mime
View raw message