SQOOP-3428: Try to fix the CI (#85)
diff --git a/build.gradle b/build.gradle
index 02d069e..dd25645 100644
--- a/build.gradle
+++ b/build.gradle
@@ -179,9 +179,8 @@
testCompile group: 'mysql', name: 'mysql-connector-java', version: mySqlConnectorVersion
testCompile group: 'cubrid', name: 'cubrid-jdbc', version: cubridJdbcDriverVersion
testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: msSqlJdbcDriverVersion
- testCompile group: 'com.ibm.db2.jcc', name: 'db2jcc4', version: db2JdbcDriverVersion
+ testCompile group: 'com.ibm.db2', name: 'jcc', version: db2JdbcDriverVersion
testCompile group: 'oracle', name: 'ojdbc6', version: oracleJdbcDriverVersion
-
}
task unitTest (type: Test) {
diff --git a/gradle.properties b/gradle.properties
index 025c4cd..56cf303 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -54,7 +54,7 @@
mySqlConnectorVersion=5.1.47
cubridJdbcDriverVersion=10.1.2.7694
msSqlJdbcDriverVersion=7.0.0.jre8
-db2JdbcDriverVersion=10.1
+db2JdbcDriverVersion=11.5.0.0
oracleJdbcDriverVersion=11.2.0.3
checkstyleVersion=5.5
diff --git a/src/scripts/thirdpartytest/docker-compose/db2scripts/db2entrypoint.sh b/src/scripts/thirdpartytest/docker-compose/db2scripts/db2entrypoint.sh
deleted file mode 100755
index 2397ab8..0000000
--- a/src/scripts/thirdpartytest/docker-compose/db2scripts/db2entrypoint.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-set -e
-echo -e "$DB2INST1_PASSWORD\n$DB2INST1_PASSWORD" | passwd db2inst1
-su - db2inst1 -c "db2start;db2 create db SQOOP"
-nohup /usr/sbin/sshd -D 2>&1 > /dev/null &
-while true; do sleep 1000; done
diff --git a/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml b/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml
index 0754c9c..3b8690e 100644
--- a/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml
+++ b/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml
@@ -110,18 +110,16 @@
timeout: 5s
retries: 50
db2:
- image: ibmcom/db2express-c:10.5.0.5-3.10.0
+ image: ibmcom/db2:11.5.0.0a
container_name: sqoop_db2_container
+ privileged: true
environment:
COMPOSE_HTTP_TIMEOUT: 200
DB2INST1_PASSWORD: Sqoop12345
+ DBNAME: SQOOP
LICENSE: accept
ports:
- 50000:50000
- volumes:
- - ./db2scripts:/home/db2inst1/db2scripts
- entrypoint:
- /home/db2inst1/db2scripts/db2entrypoint.sh
healthcheck:
test: ["CMD", "/home/db2inst1/sqllib/bin/db2", "CONNECT", "TO", "SQOOP"]
interval: 30s
diff --git a/src/test/org/apache/sqoop/metastore/JobToolTestBase.java b/src/test/org/apache/sqoop/metastore/JobToolTestBase.java
index 214063d..141602b 100644
--- a/src/test/org/apache/sqoop/metastore/JobToolTestBase.java
+++ b/src/test/org/apache/sqoop/metastore/JobToolTestBase.java
@@ -70,9 +70,7 @@
SqoopOptions options = getSqoopOptions();
- Connection conn = getConnection(options);
-
- try {
+ try(Connection conn = getConnection(options)) {
Statement statement = conn.createStatement();
statement.execute("DROP TABLE " + cm.escapeTableName("SQOOP_ROOT"));
statement.execute("DROP TABLE " + cm.escapeTableName("SQOOP_SESSIONS"));