You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ja...@apache.org on 2015/12/24 09:22:22 UTC

sqoop git commit: SQOOP-2754: Sqoop2: Fix bug in integration test for Mysql and Postgresql

Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 889fde9a1 -> bf5cc533b


SQOOP-2754: Sqoop2: Fix bug in integration test for Mysql and Postgresql

(Colin Ma via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: bf5cc533b3259559eb03c3baa947e2e47480cc3d
Parents: 889fde9
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Thu Dec 24 09:21:48 2015 +0100
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Thu Dec 24 09:21:48 2015 +0100

----------------------------------------------------------------------
 .../sqoop/integration/repository/mysql/TestJobHandling.java | 9 +++++++--
 .../repository/postgresql/PostgresqlTestCase.java           | 3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/bf5cc533/repository/repository-mysql/src/test/java/org/apache/sqoop/integration/repository/mysql/TestJobHandling.java
----------------------------------------------------------------------
diff --git a/repository/repository-mysql/src/test/java/org/apache/sqoop/integration/repository/mysql/TestJobHandling.java b/repository/repository-mysql/src/test/java/org/apache/sqoop/integration/repository/mysql/TestJobHandling.java
index 7a87fee..9109212 100644
--- a/repository/repository-mysql/src/test/java/org/apache/sqoop/integration/repository/mysql/TestJobHandling.java
+++ b/repository/repository-mysql/src/test/java/org/apache/sqoop/integration/repository/mysql/TestJobHandling.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.integration.repository.mysql;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -145,9 +146,13 @@ public class TestJobHandling extends MySqlTestCase {
         .findJobsForConnectorUpgrade(
           handler.findConnector("A", provider.getConnection())
             .getPersistenceId(), provider.getConnection());
+    List<String> jobNames = new ArrayList<String>();
+    for (MJob job : list) {
+      jobNames.add(job.getName());
+    }
     assertEquals(2, list.size());
-    assertEquals(JOB_A_NAME, list.get(0).getName());
-    assertEquals(JOB_B_NAME, list.get(1).getName());
+    assertTrue(jobNames.contains(JOB_A_NAME));
+    assertTrue(jobNames.contains(JOB_B_NAME));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/sqoop/blob/bf5cc533/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/PostgresqlTestCase.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/PostgresqlTestCase.java b/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/PostgresqlTestCase.java
index 2311f8b..4ddfbc3 100644
--- a/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/PostgresqlTestCase.java
+++ b/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/PostgresqlTestCase.java
@@ -62,7 +62,8 @@ abstract public class PostgresqlTestCase {
   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception {
     provider.start();
-
+    // clear the data for sqoop
+    provider.dropSchema("SQOOP");
     handler = new PostgresqlRepositoryHandler();
     handler.createOrUpgradeRepository(provider.getConnection());
   }