sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cheol...@apache.org
Subject [1/2] git commit: SQOOP-859: PostgreSQL: Test cases have hard coded username and password
Date Sat, 02 Mar 2013 00:25:45 GMT
SQOOP-859: PostgreSQL: Test cases have hard coded username and password

(Jarcec Cecho via Cheolsoo Park)


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

Branch: refs/heads/trunk
Commit: 1d9339d2a4495a09b923d0051b723db26232148f
Parents: 4aa174a
Author: Cheolsoo Park <cheolsoo@apache.org>
Authored: Fri Mar 1 16:19:16 2013 -0800
Committer: Cheolsoo Park <cheolsoo@apache.org>
Committed: Fri Mar 1 16:19:16 2013 -0800

----------------------------------------------------------------------
 .../sqoop/manager/PostgresqlExportTest.java        |   16 ++++++++++----
 .../sqoop/manager/PostgresqlImportTest.java        |   15 ++++++++++---
 2 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/1d9339d2/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 e85e62a..0ac4599 100644
--- a/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
+++ b/src/test/com/cloudera/sqoop/manager/PostgresqlExportTest.java
@@ -44,11 +44,17 @@ public class PostgresqlExportTest extends ExportJobTestCase {
       PostgresqlExportTest.class.getName());
 
   static final String HOST_URL = System.getProperty(
-      "sqoop.test.postgresql.connectstring.host_url",
-      "jdbc:postgresql://localhost/");
+    "sqoop.test.postgresql.connectstring.host_url",
+    "jdbc:postgresql://localhost/");
+  static final String DATABASE_USER = System.getProperty(
+    "sqoop.test.postgresql.connectstring.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");
 
-  static final String DATABASE_USER = "sqooptest";
-  static final String DATABASE_NAME = "sqooptest";
   static final String TABLE_NAME = "EMPLOYEES_PG";
   static final String PROCEDURE_NAME = "INSERT_AN_EMPLOYEE";
   static final String STAGING_TABLE_NAME = "STAGING";
@@ -70,7 +76,7 @@ public class PostgresqlExportTest extends ExportJobTestCase {
     LOG.debug("Setting up postgresql test: " + CONNECT_STRING);
 
     try {
-      connection = DriverManager.getConnection(HOST_URL, DATABASE_USER, null);
+      connection = DriverManager.getConnection(CONNECT_STRING, DATABASE_USER, PASSWORD);
       connection.setAutoCommit(false);
     } catch (SQLException ex) {
       LOG.error("Can't create connection", ex);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/1d9339d2/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 3fadff7..7414199 100644
--- a/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
+++ b/src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
@@ -86,11 +86,17 @@ public class PostgresqlImportTest extends ImportJobTestCase {
       PostgresqlImportTest.class.getName());
 
   static final String HOST_URL = System.getProperty(
-      "sqoop.test.postgresql.connectstring.host_url",
-      "jdbc:postgresql://localhost/");
+    "sqoop.test.postgresql.connectstring.host_url",
+    "jdbc:postgresql://localhost/");
+  static final String DATABASE_USER = System.getProperty(
+    "sqoop.test.postgresql.connectstring.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");
 
-  static final String DATABASE_USER = "sqooptest";
-  static final String DATABASE_NAME = "sqooptest";
   static final String TABLE_NAME = "EMPLOYEES_PG";
   static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_PG";
   static final String SPECIAL_TABLE_NAME = "EMPLOYEES_PG's";
@@ -121,6 +127,7 @@ public class PostgresqlImportTest extends ImportJobTestCase {
   public void setUpData(String tableName, String schema, boolean nullEntry) {
     SqoopOptions options = new SqoopOptions(CONNECT_STRING, tableName);
     options.setUsername(DATABASE_USER);
+    options.setPassword(PASSWORD);
 
     ConnManager manager = null;
     Connection connection = null;


Mime
View raw message