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/02/12 03:42:02 UTC

sqoop git commit: SQOOP-2099: Sqoop2: Postgresql's detectRepositoryVersion uses wrong casing

Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 116ed9644 -> f826c50f2


SQOOP-2099: Sqoop2: Postgresql's detectRepositoryVersion uses wrong casing

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

Branch: refs/heads/sqoop2
Commit: f826c50f2ce242964ce949085f2752a640a6a611
Parents: 116ed96
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Wed Feb 11 18:18:31 2015 -0800
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Wed Feb 11 18:18:31 2015 -0800

----------------------------------------------------------------------
 .../postgresql/PostgresqlRepositoryHandler.java |  4 +-
 .../repository/postgresql/TestHandler.java      | 40 ++++++++++++++++++++
 2 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/f826c50f/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java
index f54bd22..5ecc53a 100644
--- a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java
+++ b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlRepositoryHandler.java
@@ -79,8 +79,8 @@ public class PostgresqlRepositoryHandler extends CommonRepositoryHandler {
     try {
       DatabaseMetaData md = conn.getMetaData();
       metadataResultSet = md.getTables(null,
-          CommonRepositorySchemaConstants.SCHEMA_SQOOP.toLowerCase(),
-          CommonRepositorySchemaConstants.TABLE_SQ_SYSTEM_NAME.toLowerCase(), null);
+          CommonRepositorySchemaConstants.SCHEMA_SQOOP,
+          CommonRepositorySchemaConstants.TABLE_SQ_SYSTEM_NAME, null);
 
       if (metadataResultSet.next()) {
         stmt = conn.prepareStatement(PostgresqlSchemaQuery.STMT_SELECT_SYSTEM);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f826c50f/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/TestHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/TestHandler.java b/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/TestHandler.java
new file mode 100644
index 0000000..288e403
--- /dev/null
+++ b/repository/repository-postgresql/src/test/java/org/apache/sqoop/integration/repository/postgresql/TestHandler.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.integration.repository.postgresql;
+
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+
+/**
+ * Test connector methods on Derby repository.
+ */
+@Test(groups = "postgresql")
+public class TestHandler extends PostgresqlTestCase {
+
+  @Test
+  public void testHasLatestRepositoryVersion() throws Exception {
+    assertTrue(handler.isRepositorySuitableForUse(provider.getConnection()));
+  }
+
+  @Test
+  public void testDoubleUpdate() throws Exception {
+    handler.createOrUpgradeRepository(provider.getConnection());
+    assertTrue(handler.isRepositorySuitableForUse(provider.getConnection()));
+  }
+}