sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mau...@apache.org
Subject [2/3] sqoop git commit: SQOOP-3197: Database credentials cannot be configured in PostgreSQL third party tests
Date Fri, 21 Jul 2017 11:29:53 GMT
SQOOP-3197: Database credentials cannot be configured in PostgreSQL third party tests

(Szabolcs Vasas via Anna Szonyi)


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

Branch: refs/heads/branch-1.4.7
Commit: 33be84452a7a175bd4762fb68ef3d72d55c42412
Parents: 53cedb9
Author: Anna Szonyi <annaszonyi@apache.org>
Authored: Thu Jul 6 16:44:05 2017 +0200
Committer: Attila Szabo <maugli@apache.org>
Committed: Fri Jul 21 11:31:17 2017 +0200

----------------------------------------------------------------------
 build.xml                                       |  6 ++++
 .../DirectPostgreSQLExportManualTest.java       | 33 ++++++++++++++++++--
 .../sqoop/manager/PostgresqlExportTest.java     |  8 +++--
 .../PostgresqlExternalTableImportTest.java      |  8 +++--
 .../sqoop/manager/PostgresqlImportTest.java     |  9 ++++--
 5 files changed, 53 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/33be8445/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 110cfa5..ede5ba8 100644
--- a/build.xml
+++ b/build.xml
@@ -218,6 +218,9 @@
   <property name="sqoop.test.postgresql.username"
             value="sqooptest" />
 
+  <property name="sqoop.test.postgresql.password"
+            value="" />
+
   <property name="sqoop.test.postgresql.pg_bulkload"
             value="pg_bulkload" />
 
@@ -847,6 +850,9 @@
       <sysproperty key="sqoop.test.postgresql.username"
                    value="${sqoop.test.postgresql.username}" />
 
+      <sysproperty key="sqoop.test.postgresql.password"
+                   value="${sqoop.test.postgresql.password}" />
+
       <sysproperty key="sqoop.test.postgresql.pg_bulkload"
                    value="${sqoop.test.postgresql.pg_bulkload}" />
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/33be8445/src/test/com/cloudera/sqoop/manager/DirectPostgreSQLExportManualTest.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/manager/DirectPostgreSQLExportManualTest.java b/src/test/com/cloudera/sqoop/manager/DirectPostgreSQLExportManualTest.java
index 52095ef..b7c7416 100644
--- a/src/test/com/cloudera/sqoop/manager/DirectPostgreSQLExportManualTest.java
+++ b/src/test/com/cloudera/sqoop/manager/DirectPostgreSQLExportManualTest.java
@@ -29,6 +29,8 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.mapred.JobConf;
 import com.cloudera.sqoop.TestExport;
 import com.cloudera.sqoop.mapreduce.db.DBConfiguration;
+import org.junit.Ignore;
+import org.junit.Test;
 
 
 /**
@@ -64,6 +66,8 @@ public class DirectPostgreSQLExportManualTest extends TestExport {
     System.getProperty("sqoop.test.postgresql.database", "sqooptest");
   static final String USERNAME =
     System.getProperty("sqoop.test.postgresql.username", "sqooptest");
+  static final String PASSWORD = System.getProperty(
+      "sqoop.test.postgresql.password");
   static final String CONNECT_STRING = HOST_URL + DATABASE;
 
   public DirectPostgreSQLExportManualTest() {
@@ -72,7 +76,7 @@ public class DirectPostgreSQLExportManualTest extends TestExport {
                                 "org.postgresql.Driver",
                                 getConnectString(),
                                 getUserName(),
-                                (String) null, (Integer) null);
+                                PASSWORD, (Integer) null);
     dbConf = new DBConfiguration(conf);
   }
 
@@ -138,6 +142,8 @@ public class DirectPostgreSQLExportManualTest extends TestExport {
         new ArrayList<String>(Arrays.asList(additionalArgv));
     args.add("--username");
     args.add(getUserName());
+    args.add("--password");
+    args.add(PASSWORD);
     args.add("--direct");
     return super.getArgv(includeHadoopFlags,
                          rowsPerStatement,
@@ -150,11 +156,34 @@ public class DirectPostgreSQLExportManualTest extends TestExport {
     ArrayList<String> args = new ArrayList<String>(Arrays.asList(extraArgs));
     args.add("--username");
     args.add(getUserName());
+    args.add("--password");
+    args.add(PASSWORD);
     return super.getCodeGenArgv(args.toArray(new String[0]));
   }
 
+  @Ignore("Ignoring this test case as direct export does not support --columns option.")
   @Override
+  @Test
   public void testColumnsExport() throws IOException, SQLException {
-    // Direct export does not support --columns option.
   }
+
+  @Ignore("Ignoring this test case as the scenario is not supported with direct export.")
+  @Override
+  @Test
+  public void testLessColumnsInFileThanInTable() throws IOException, SQLException {
+  }
+
+  @Ignore("Ignoring this test case as the scenario is not supported with direct export.")
+  @Override
+  @Test
+  public void testLessColumnsInFileThanInTableInputNullIntPassed() throws IOException, SQLException
{
+  }
+
+  @Ignore("Ignoring this test case as the scenario is not supported with direct export.")
+  @Override
+  @Test
+  public void testLessColumnsInFileThanInTableInputNullStringPassed() throws IOException,
SQLException {
+  }
+
+
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/33be8445/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java b/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
index 38d6ba6..3323d07 100644
--- a/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
+++ b/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
@@ -51,13 +51,13 @@ public class PostgresqlExportTest extends ExportJobTestCase {
     "sqoop.test.postgresql.connectstring.host_url",
     "jdbc:postgresql://localhost/");
   static final String DATABASE_USER = System.getProperty(
-    "sqoop.test.postgresql.connectstring.username",
+    "sqoop.test.postgresql.username",
     "sqooptest");
   static final String DATABASE_NAME = System.getProperty(
-    "sqoop.test.postgresql.connectstring.database",
+    "sqoop.test.postgresql.database",
     "sqooptest");
   static final String PASSWORD = System.getProperty(
-    "sqoop.test.postgresql.connectstring.password");
+    "sqoop.test.postgresql.password");
 
   static final String TABLE_NAME = "EMPLOYEES_PG";
   static final String PROCEDURE_NAME = "INSERT_AN_EMPLOYEE";
@@ -286,6 +286,8 @@ public class PostgresqlExportTest extends ExportJobTestCase {
     args.add(CONNECT_STRING);
     args.add("--username");
     args.add(DATABASE_USER);
+    args.add("--password");
+    args.add(PASSWORD);
     args.add("-m");
     args.add("1");
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/33be8445/src/test/com/cloudera/sqoop/manager/PostgresqlExternalTableImportTest.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/manager/PostgresqlExternalTableImportTest.java b/src/test/com/cloudera/sqoop/manager/PostgresqlExternalTableImportTest.java
index 0515e09..6403b32 100644
--- a/src/test/com/cloudera/sqoop/manager/PostgresqlExternalTableImportTest.java
+++ b/src/test/com/cloudera/sqoop/manager/PostgresqlExternalTableImportTest.java
@@ -35,10 +35,10 @@ public class PostgresqlExternalTableImportTest extends ImportJobTestCase
{
   static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url",
       "jdbc:postgresql://localhost/");
   static final String DATABASE_USER = System.getProperty(
-      "sqoop.test.postgresql.connectstring.username", "sqooptest");
+      "sqoop.test.postgresql.username", "sqooptest");
   static final String DATABASE_NAME = System.getProperty(
-      "sqoop.test.postgresql.connectstring.database", "sqooptest");
-  static final String PASSWORD = System.getProperty("sqoop.test.postgresql.connectstring.password");
+      "sqoop.test.postgresql.database", "sqooptest");
+  static final String PASSWORD = System.getProperty("sqoop.test.postgresql.password");
 
   static final String TABLE_NAME = "EMPLOYEES_PG";
   static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_PG";
@@ -193,6 +193,8 @@ public class PostgresqlExternalTableImportTest extends ImportJobTestCase
{
     args.add(CONNECT_STRING);
     args.add("--username");
     args.add(DATABASE_USER);
+    args.add("--password");
+    args.add(PASSWORD);
     args.add("--where");
     args.add("id > 1");
     args.add("-m");

http://git-wip-us.apache.org/repos/asf/sqoop/blob/33be8445/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java b/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
index 5872d25..ceae47c 100644
--- a/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
+++ b/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
@@ -94,13 +94,13 @@ public class PostgresqlImportTest extends ImportJobTestCase {
     "sqoop.test.postgresql.connectstring.host_url",
     "jdbc:postgresql://localhost/");
   static final String DATABASE_USER = System.getProperty(
-    "sqoop.test.postgresql.connectstring.username",
+    "sqoop.test.postgresql.username",
     "sqooptest");
   static final String DATABASE_NAME = System.getProperty(
-    "sqoop.test.postgresql.connectstring.database",
+    "sqoop.test.postgresql.database",
     "sqooptest");
   static final String PASSWORD = System.getProperty(
-    "sqoop.test.postgresql.connectstring.password");
+    "sqoop.test.postgresql.password");
 
   static final String TABLE_NAME = "EMPLOYEES_PG";
   static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_PG";
@@ -258,6 +258,8 @@ public class PostgresqlImportTest extends ImportJobTestCase {
     args.add(CONNECT_STRING);
     args.add("--username");
     args.add(DATABASE_USER);
+    args.add("--password");
+    args.add(PASSWORD);
     args.add("--where");
     args.add("id > 1");
     args.add("-m");
@@ -342,6 +344,7 @@ public class PostgresqlImportTest extends ImportJobTestCase {
     SqoopOptions options = new SqoopOptions(new Configuration());
     options.setConnectString(CONNECT_STRING);
     options.setUsername(DATABASE_USER);
+    options.setPassword(PASSWORD);
 
     ConnManager mgr = new PostgresqlManager(options);
     String[] tables = mgr.listTables();


Mime
View raw message