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 f54bd228..5ecc53aa 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 int detectRepositoryVersion(Connection conn) { 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); 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 00000000..288e403e --- /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())); + } +}