From cbc39c3bfa04001a411fda456429e686220ecbba Mon Sep 17 00:00:00 2001 From: Fero Szabo Date: Fri, 23 Nov 2018 15:05:05 +0100 Subject: [PATCH] Revert "SQOOP-3289: Add .travis.yml" This reverts commit 83a18e195111adb9f906401b0c030666378bae69. Reverting because of accidental inclusion of .cache file. --- .travis.yml | 82 ------ COMPILING.txt | 248 ++++++++++-------- build.gradle | 100 ------- build.xml | 61 ++--- gradle.properties | 5 - .../oraclescripts/ee-healthcheck.sh | 19 -- .../oraclescripts/healthcheck.sh | 2 +- .../oraclescripts/startup/.cache | 3 - .../sqoop-thirdpartytest-db-services.yml | 27 +- .../sqoop/manager/cubrid/CubridTestUtils.java | 8 +- ...DB2ImportAllTableWithSchemaManualTest.java | 20 +- .../db2/DB2ManagerImportManualTest.java | 19 +- .../sqoop/manager/db2/DB2TestUtils.java | 28 -- .../db2/DB2XmlTypeImportManualTest.java | 20 +- .../sqoop/manager/mysql/MySQLTestUtils.java | 16 +- .../sqoop/manager/oracle/ExportTest.java | 15 -- .../sqoop/manager/oracle/ImportTest.java | 15 -- .../sqoop/manager/oracle/OraOopTestCase.java | 27 +- .../sqoop/manager/oracle/OraOopTypesTest.java | 16 -- .../oracle/OracleConnectionFactoryTest.java | 4 +- .../manager/oracle/TimestampDataTest.java | 15 -- .../manager/oracle/util/OracleUtils.java | 11 +- .../DirectPostgreSQLExportManualTest.java | 17 +- .../PGBulkloadManagerManualTest.java | 15 +- .../postgresql/PostgresqlExportTest.java | 17 +- .../PostgresqlExternalTableImportTest.java | 11 +- .../postgresql/PostgresqlTestUtil.java | 8 +- .../manager/sqlserver/MSSQLTestUtils.java | 8 +- .../sqlserver/SQLServerManagerExportTest.java | 17 +- .../sqlserver/SQLServerManagerImportTest.java | 17 +- .../sqoop/metastore/db2/DB2JobToolTest.java | 21 +- .../DB2MetaConnectIncrementalImportTest.java | 21 +- .../sqoop/metastore/db2/DB2SavedJobsTest.java | 21 +- .../postgres/PostgresJobToolTest.java | 13 +- ...tgresMetaConnectIncrementalImportTest.java | 13 +- .../postgres/PostgresSavedJobsTest.java | 13 +- .../thirdpartytest/OracleEeTest.java | 26 -- 37 files changed, 395 insertions(+), 604 deletions(-) delete mode 100644 .travis.yml delete mode 100755 src/scripts/thirdpartytest/docker-compose/oraclescripts/ee-healthcheck.sh delete mode 100644 src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/.cache delete mode 100644 src/test/org/apache/sqoop/manager/db2/DB2TestUtils.java delete mode 100644 src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleEeTest.java diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2a9c388..00000000 --- a/.travis.yml +++ /dev/null @@ -1,82 +0,0 @@ -# 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. - -dist: trusty -sudo: true -language: java -jdk: -- oraclejdk8 -services: -- docker -env: -- TEST_TASK=test -- TEST_TASK=oracleXeTest -- TEST_TASK=sqlServerTest -- TEST_TASK=mySqlTest -- TEST_TASK=postgreSqlTest -- TEST_TASK=db2Test -- TEST_TASK=cubridTest -- TEST_TASK=mainFrameTest -before_install: -- if [ "$TEST_TASK" = "postgreSqlTest" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh postgresql; - sleep 60; - elif [ "$TEST_TASK" = "mySqlTest" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh mysql; - sleep 60; - elif [ "$TEST_TASK" = "cubridTest" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh cubrid; - sleep 60; - elif [ "$TEST_TASK" = "sqlServerTest" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh mssql; - sleep 60; - elif [ "$TEST_TASK" = "db2Test" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh db2; - sleep 60; - elif [ "$TEST_TASK" = "mainFrameTest" ]; - then - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh mainframe; - sleep 60; - elif [ "$TEST_TASK" = "oracleXeTest" ]; - then - if [ -n "$ORACLE_DRIVER_URL" ]; - then - mkdir -p drivers; - wget -q $ORACLE_DRIVER_URL --output-document ./drivers/oracledriver.jar; - ./src/scripts/thirdpartytest/start-thirdpartytest-db-containers.sh oracle; - sleep 90; - fi - fi -script: -- if [ "$TEST_TASK" != "oracleXeTest" ] || [ -n "$ORACLE_DRIVER_URL" ]; - then - ./gradlew -Dsqoop.thirdparty.lib.dir=./drivers $TEST_TASK; - else - echo 'Skipping Oracle XE test execution because ORACLE_DRIVER_URL is not set.'; - fi -before_cache: -- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock -- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/COMPILING.txt b/COMPILING.txt index 348dae0f..b399ba82 100644 --- a/COMPILING.txt +++ b/COMPILING.txt @@ -87,22 +87,22 @@ The following table shows the currently supported test categories and their hier .Available test categories [width="40%",frame="topbot",options="header"] -|=============================================================== -|Category |Subcategories | -.3+|+SqoopTest+ |+UnitTest+ | - |+IntegrationTest+ | - |+ManualTest+ | -.9+|+ThirdPartyTest+ |+CubridTest+ | - |+Db2Test+ | - |+MainFrameTest+ | - |+MysqlTest+ | - |+NetezzaTest+ | - |+OracleTest+ |+OracleEeTest+ - |+PostgresqlTest+ | - |+SqlServerTest+ | - |+S3Test+ | -|+KerberizedTest+ | | -|=============================================================== +|====================== +|Category |Subcategory +.3+|+SqoopTest+ |+UnitTest+ + |+IntegrationTest+ + |+ManualTest+ +.9+|+ThirdPartyTest+ |+CubridTest+ + |+Db2Test+ + |+MainFrameTest+ + |+MysqlTest+ + |+NetezzaTest+ + |+OracleTest+ + |+PostgresqlTest+ + |+SqlServerTest+ + |+S3Test+ +|+KerberizedTest+ | +|====================== ==== SqoopTest A general category including UnitTest, IntegrationTest and ManualTest. @@ -143,14 +143,6 @@ corresponding marker interface to it. * +integrationTest+: Runs integration tests which do not need a docker container or an external database/service. * +kerberizedTest+: Runs kerberized tests. * +thirdPartyTest+: Runs third-party tests. For more information see the 'Third party tests' section. -* +postgreSqlTest+: Runs PostgreSql third-party tests. -* +mySqlTest+: Runs MySql third-party tests. -* +cubridTest+: Runs Cubrid third-party tests. -* +db2Test+: Runs DB2 third-party tests. -* +oracleTest+: Runs Oracle third-party tests. -* +oracleXeTest+: Run Oracle third party tests which can be run with Oracle Express Edition too. -* +oracleEeTest+: Run Oracle third party tests which require Oracle Enterprise Edition. -* +sqlServerTest+: Runs SqlServer third-party tests. * +test+: Runs tests that do not need external JDBC driver and/or a docker container. This the same as running unitTest, integrationTest and kerberizedTest. * +s3Test+: Runs S3 tests. For more information see the 'Amazon S3 tests' section. @@ -180,41 +172,36 @@ JDBC. Instructions for configuring the MySQL database are in MySQLAuthTest and DirectMySQLTest. Use the following system properties to configure connection to the MySQL host used for testing: -+sqoop.test.mysql.connectstring.host_url+, +sqoop.test.mysql.databasename+, +sqoop.test.mysql.username+ and -+sqoop.test.mysql.password+. +sqoop.test.mysql.connectstring.host_url, sqoop.test.mysql.databasename, sqoop.test.mysql.username and +sqoop.test.mysql.password. Specify these properties on the command line or via the build.properties file. For example: -+sqoop.test.mysql.connectstring.host_url=jdbc:mysql://host.example.com/+ -+sqoop.test.mysql.databasename=MYDB+ -+sqoop.test.mysql.username=MYUSR+ -+sqoop.test.mysql.password=MYPWD+ +sqoop.test.mysql.connectstring.host_url=jdbc:mysql://host.example.com/ +sqoop.test.mysql.databasename=MYDB +sqoop.test.mysql.username=MYUSR +sqoop.test.mysql.password=MYPWD If not specified, the default value used for this property is: -+jdbc:mysql://127.0.0.1:13306/+ +jdbc:mysql://localhost/ ===== Oracle Install Oracle Enterprise Edition 10.2.0+. Instructions for configuring the -database are in +OracleManagerTest+. Download the ojdbc6_g jar. +database are in OracleManagerTest. Download the ojdbc6_g jar. If running the tests against Oracle XE (Express Edition) - a lot of them will fail as it does not include the partitioning feature. -Use the following system properties to configure connection to the Oracle XE host used for testing: -+sqoop.test.oracle.connectstring+, +sqoop.test.oracle.username+ and +sqoop.test.oracle.password+. -You can configure the connection properties separately for tests requiring Oracle EE: -+sqoop.test.oracle-ee.connectstring+, +sqoop.test.oracle-ee.username+ and +sqoop.test.oracle-ee.password+. +Use the following system properties to configure connection to the Oracle host used for testing: +sqoop.test.oracle.connectstring, sqoop.test.oracle.username and sqoop.test.oracle.password. Specify these properties on the command line or via the build.properties file. For example: -+sqoop.test.oracle.connectstring=jdbc:oracle:thin:@//host.example.com/xe+ -+sqoop.test.oracle.username=MYUSR+ -+sqoop.test.oracle.password=MYPWD+ +sqoop.test.oracle.connectstring=jdbc:oracle:thin:@//host.example.com/xe +sqoop.test.oracle.username=MYUSR +sqoop.test.oracle.password=MYPWD -If not specified, the default value used for +sqoop.test.oracle.connectstring+ property is: -+jdbc:oracle:thin:@//localhost:1521/xe+ - -The default value used for +sqoop.test.oracle-ee.connectstring+ property is: -+jdbc:oracle:thin:@//localhost:1522/sqoop+ +If not specified, the default value used for this property is: +jdbc:oracle:thin:@//localhost/xe Users sqooptest and sqooptest2 should be created prior to running the tests. SQL script is available in src/test/oraoop/create_users.sql @@ -222,104 +209,106 @@ SQL script is available in src/test/oraoop/create_users.sql ===== PostgreSQL Install PostgreSQL 8.3.9. Download the postgresql 8.4 jdbc driver. Instructions -for configuring the database are in +PostgresqlTest+. +for configuring the database are in PostgresqlTest. Use the following system properties to configure connection to the PostgreSQL host used for testing: -+sqoop.test.postgresql.connectstring.host_url+, +sqoop.test.postgresql.database+, +sqoop.test.postgresql.username+ and -+sqoop.test.postgresql.password+. +sqoop.test.postgresql.connectstring.host_url, sqoop.test.postgresql.database, sqoop.test.postgresql.username and +sqoop.test.postgresql.password. Specify this property on the command line or via the build.properties file. For example: -+sqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://sqoop-dbs.sf.cloudera.com/+ -+sqoop.test.postgresql.database=MYDB+ -+sqoop.test.postgresql.username=MYUSR+ -+sqoop.test.postgresql.password=MYPWD+ +sqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://sqoop-dbs.sf.cloudera.com/ +sqoop.test.postgresql.database=MYDB +sqoop.test.postgresql.username=MYUSR +sqoop.test.postgresql.password=MYPWD If not specified, the default value used for this property is: -+jdbc:postgresql://localhost:15432/+ +jdbc:postgresql://localhost/ ===== SQL Server Install SQL Server Express 2012 and create a database instance and download the appropriate JDBC driver. Instructions for configuring the -database can be found in +SQLServerManagerImportManualTest+. +database can be found in SQLServerManagerImportManualTest. Use the following system properties to configure connection to the SQL Server host used for testing: -+sqoop.test.sqlserver.connectstring.host_url+, +sqoop.test.sqlserver.database+, +ms.sqlserver.username+ and -+ms.sqlserver.password+. +sqoop.test.sqlserver.connectstring.host_url, sqoop.test.sqlserver.database, sqoop.test.sqlserver.username and +sqoop.test.sqlserver.password. the URL for the SQL Server host used for testing. Specify this property on the command line or via the build.properties file. For example: -+sqoop.test.sqlserver.connectstring.host_url=jdbc:sqlserver://sqlserverhost:1433+ -+sqoop.test.sqlserver.database=MYDB+ -+ms.sqlserver.username=MYUSR+ -+ms.sqlserver.password=MYPWD+ +sqoop.test.sqlserver.connectstring.host_url=jdbc:sqlserver://sqlserverhost:1433 +sqoop.test.sqlserver.database=MYDB +ms.sqlserver.username=MYUSR +ms.sqlserver.password=MYPWD If not specified, the default value used for this property is: -+jdbc:sqlserver://localhost:1433+ +jdbc:sqlserver://sqlserverhost:1433 + +This can be useful if you have the hostname sqlserverhost mapped to the IP +address of the SQL Server instance. ===== Cubrid Install Cubrid 9.2.2.0003 and create a database instance and download the appropriate JDBC driver. Instructions for configuring the database are in -+CubridAuthTest+, +CubridCompatTest+, +CubridManagerImportTest+ -and +CubridManagerExportTest+. +CubridAuthTest, CubridCompatTest, CubridManagerImportTest +and CubridManagerExportTest. Use the following system properties to configure connection to the Cubrid host used for testing: -+sqoop.test.cubrid.connectstring.host_url+, +sqoop.test.cubrid.connectstring.database+, -+sqoop.test.cubrid.connectstring.username+ and +sqoop.test.cubrid.connectstring.password+. +sqoop.test.cubrid.connectstring.host_url, sqoop.test.cubrid.connectstring.database, +sqoop.test.cubrid.connectstring.username and sqoop.test.cubrid.connectstring.password. Specify this property on the command line or via the build.properties file. For example: -+sqoop.test.cubrid.connectstring.host_url=jdbc:cubrid:localhost+ -+sqoop.test.cubrid.connectstring.database=MYDB+ -+sqoop.test.cubrid.connectstring.username=MYUSR+ -+sqoop.test.cubrid.connectstring.password=MYPWD+ +sqoop.test.cubrid.connectstring.host_url=jdbc:cubrid:localhost +sqoop.test.cubrid.connectstring.database=MYDB +sqoop.test.cubrid.connectstring.username=MYUSR +sqoop.test.cubrid.connectstring.password=MYPWD If not specified, the default value used for this property is: -+jdbc:cubrid:localhost:33000+ +jdbc:cubrid:localhost ===== DB2 Install DB2 9.74 Express C and download the appropriate JDBC driver. Instructions for configuring the server can be found in -+DB2ManagerImportManualTest+. +DB2ManagerImportManualTest. Use the following system properties to configure connection to the DB2 host used for testing: -+sqoop.test.db2.connectstring.host_url+, +sqoop.test.db2.connectstring.database+, +sqoop.test.db2.connectstring.username+ and -+sqoop.test.db2.connectstring.password+. +sqoop.test.db2.connectstring.host_url, sqoop.test.db2.connectstring.database, sqoop.test.db2.connectstring.username and +sqoop.test.db2.connectstring.password. Specify this property on the command line or via build.properties file. For example: -+sqoop.test.db2.connectstring.host_url=jdbc:db2://db2host:50000+ -+sqoop.test.db2.connectstring.database=MYDB+ -+sqoop.test.db2.connectstring.username=MYUSR+ -+sqoop.test.db2.connectstring.password=MYPWD+ +sqoop.test.db2.connectstring.host_url=jdbc:db2://db2host:50000 +sqoop.test.db2.connectstring.database=MYDB +sqoop.test.db2.connectstring.username=MYUSR +sqoop.test.db2.connectstring.password=MYPWD If not specified, the default value used for this property is: -+jdbc:db2://localhost:50000+ +jdbc:db2://db2host:50000 + +This can be useful if you have the hostname db2host mapped to the IP +address of the DB2 Server instance. ==== Running the Third-party Tests on native database servers After the third-party databases are installed and configured, run: ----- -ant test -Dthirdparty=true -Dsqoop.thirdparty.lib.dir=/path/to/jdbc/drivers/ [-DconnectionProperty1=propertyValue1 --DconnectionProperty2=propertyValue ...] -./gradlew -Dsqoop.thirdparty.lib.dir=/relative/path/to/jdbc/drivers/ thirdPartyTest [-DconnectionProperty1=propertyValue1 --DconnectionProperty2=propertyValue ...] ----- +++++ +ant test -Dthirdparty=true -Dsqoop.thirdparty.lib.dir=/path/to/jdbc/drivers/ +./gradlew -Dsqoop.thirdparty.lib.dir=/relative/path/to/jdbc/drivers/ thirdPartyTest +++++ This command will run all thirdparty tests except some DB2 tests. To run these DB2 test, specify the property "manual" instead of "thirdparty" as follows: ----- -ant test -Dmanual=true -Dsqoop.thirdparty.lib.dir=/path/to/jdbc/drivers/ [-DconnectionProperty1=propertyValue1 --DconnectionProperty2=propertyValue ...] -./gradlew -Dsqoop.thirdparty.lib.dir=/relative/path/to/jdbc/drivers/ manualTest [-DconnectionProperty1=propertyValue1 --DconnectionProperty2=propertyValue ...] ----- +++++ +ant test -Dmanual=true -Dsqoop.thirdparty.lib.dir=/path/to/jdbc/drivers/ +./gradlew -Dsqoop.thirdparty.lib.dir=/relative/path/to/jdbc/drivers/ manualTest +++++ Note that +sqoop.thirdparty.lib.dir+ can also be specified in +build.properties+. @@ -337,11 +326,11 @@ https://docs.docker.com/compose/install/ ===== Downloading docker images -MySQL, PostgreSQL, MSSQL, DB2, Oracle XE and Cubrid images are freely available on Docker Hub so they will be pulled automatically by the startup command specified below however the Oracle EE image has to be built manually. Please refer to the README.md file on the below Github project for building instructions: +MySQL, PostgreSQL, MSSQL, DB2 and Cubrid images are freely available on Docker Hub so they will be pulled automatically by the startup command specified below however the Oracle EE image has to be built manually. Please refer to the README.md file on the below Github project for building instructions: https://github.com/oracle/docker-images/tree/master/OracleDatabase -Please note that some Sqoop third party tests require Oracle Enterprise Edition and the startup command assumes version 12.2.0.1. +Please note that Sqoop third party tests require Oracle Enterprise Edition and the startup command assumes version 12.2.0.1. ===== Starting the Docker containers @@ -361,8 +350,7 @@ If it is executed without parameters it starts the following services: |+postgresql+ |PostgreSQL 9.6.4 |+mssql+ |MSSQL 14.0.1000.169 Developer Edition |+cubrid+ |Cubrid 10.0 -|+oracle-ee+ |Oracle EE 12.2.0.1 -|+oracle+ |Oracle XE 11g Release 2 +|+oracle+ |Oracle EE 12.2.0.1 |+db2+ |DB2 Express Edition 10.5.0.5-3.10.0 |====================== @@ -379,8 +367,7 @@ After the startup script is executed the containers need some time to initialize 158e5421d134 ibmcom/db2express-c:10.5.0.5-3.10.0 "/home/db2inst1/db..." 43 seconds ago Up 40 seconds (health: starting) 22/tcp, 0.0.0.0:50000->50000/tcp sqoop_db2_container ---- -Most of the containers need less than 1 minute to start up but DB2 needs \~5 minutes and Oracle EE needs \~15 minutes. -The Docker images need \~17GB free disk space and Docker requires ~5GB of memory to start all of them at the same time. +Most of the containers need less than 1 minute to start up but DB2 needs ~5 minutes and Oracle needs ~15 minutes. The Docker images need ~17GB free disk space and Docker requires ~5GB of memory to start all of them at the same time. ===== Stopping the Docker containers @@ -397,6 +384,31 @@ You can execute the third party tests against the DBs running in Docker containe ---- ant clean test -Dthirdparty=true -Dsqoop.thirdparty.lib.dir= \ + -Dsqoop.test.mysql.connectstring.host_url=jdbc:mysql://127.0.0.1:3306/ \ + -Dsqoop.test.mysql.databasename=sqoop \ + -Dsqoop.test.mysql.password=Sqoop12345 \ + -Dsqoop.test.mysql.username=sqoop \ + -Dsqoop.test.oracle.connectstring=jdbc:oracle:thin:@//localhost:1521/sqoop \ + -Dsqoop.test.oracle.username=SYSTEM \ + -Dsqoop.test.oracle.password=Sqoop12345 \ + -Dsqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://localhost/ \ + -Dsqoop.test.postgresql.database=sqoop \ + -Dsqoop.test.postgresql.username=sqoop \ + -Dsqoop.test.postgresql.password=Sqoop12345 \ + -Dsqoop.test.cubrid.connectstring.host_url=jdbc:cubrid:localhost:33000 \ + -Dsqoop.test.cubrid.connectstring.username=sqoop \ + -Dsqoop.test.cubrid.connectstring.database=sqoop \ + -Dsqoop.test.cubrid.connectstring.password=Sqoop12345 \ + -Dmapred.child.java.opts="\-Djava.security.egd=file:/dev/../dev/urandom" \ + -Dtest.timeout=10000000 \ + -Dsqoop.test.sqlserver.connectstring.host_url=jdbc:sqlserver://localhost:1433 \ + -Dsqoop.test.sqlserver.database=master \ + -Dms.sqlserver.username=sa \ + -Dms.sqlserver.password=Sqoop12345 \ + -Dsqoop.test.db2.connectstring.host_url=jdbc:db2://localhost:50000 \ + -Dsqoop.test.db2.connectstring.database=SQOOP \ + -Dsqoop.test.db2.connectstring.username=DB2INST1 \ + -Dsqoop.test.db2.connectstring.password=Sqoop12345 \ -Ds3.bucket.url= \ -Ds3.generator.command= ---- @@ -405,14 +417,36 @@ or ---- ./gradlew -Dsqoop.thirdparty.lib.dir= \ + -Dsqoop.test.mysql.connectstring.host_url=jdbc:mysql://127.0.0.1:3306/ \ + -Dsqoop.test.mysql.databasename=sqoop \ + -Dsqoop.test.mysql.password=Sqoop12345 \ + -Dsqoop.test.mysql.username=sqoop \ + -Dsqoop.test.oracle.connectstring=jdbc:oracle:thin:@//localhost:1521/sqoop \ + -Dsqoop.test.oracle.username=SYSTEM \ + -Dsqoop.test.oracle.password=Sqoop12345 \ + -Dsqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://localhost/ \ + -Dsqoop.test.postgresql.database=sqoop \ + -Dsqoop.test.postgresql.username=sqoop \ + -Dsqoop.test.postgresql.password=Sqoop12345 \ + -Dsqoop.test.cubrid.connectstring.host_url=jdbc:cubrid:localhost:33000 \ + -Dsqoop.test.cubrid.connectstring.username=sqoop \ + -Dsqoop.test.cubrid.connectstring.database=sqoop \ + -Dsqoop.test.cubrid.connectstring.password=Sqoop12345 \ + -Dmapred.child.java.opts="\-Djava.security.egd=file:/dev/../dev/urandom" \ + -Dtest.timeout=10000000 \ + -Dsqoop.test.sqlserver.connectstring.host_url=jdbc:sqlserver://localhost:1433 \ + -Dsqoop.test.sqlserver.database=master \ + -Dms.sqlserver.username=sa \ + -Dms.sqlserver.password=Sqoop12345 \ + -Dsqoop.test.db2.connectstring.host_url=jdbc:db2://localhost:50000 \ + -Dsqoop.test.db2.connectstring.database=SQOOP \ + -Dsqoop.test.db2.connectstring.username=DB2INST1 \ + -Dsqoop.test.db2.connectstring.password=Sqoop12345 \ -Ds3.bucket.url= \ -Ds3.generator.command= \ thirdPartyTest ---- -Gradle is able download all of the necessary drivers except the Oracle one but the Ant build has to be provided -with the drivers for all the databases. - Please note that even if you do not need to install RDBMSs to run Sqoop third party tests against the Docker containers you still need to install the following tools: * mysqldump @@ -617,20 +651,4 @@ export XML_CATALOG_FILES=/usr/local/etc/xml/catalog * +./gradlew build --refresh-dependencies+ to refresh dependencies for a build * +./gradle build -x test+ for skipping a single test or a set of tests * +./gradlew dependencyInsight --configuration optionalConfiguration --dependency searchedForDependency+ to get a dependency tree -* +./gradlew dependencies+ to get the list of the dependencies of the selected project, broken down by configuration - -== Setting up Travis CI -You can now set up a Travis CI job for your own Sqoop fork so you can easily test your patches before uploading them for review. -The steps for setting up the CI job are the following: - -- Go to https://github.com/apache/sqoop and fork the project if it is not already forked for your GitHub account. -- Go to https://travis-ci.com and Sign up with GitHub. -- Accept the Authorization of Travis CI. You’ll be redirected to GitHub. -- Click the green Activate button, and select the Sqoop repository. - -The Travis CI job uses Gradle to build and test the project and it is able to execute all of the tests except the -ones requiring an Oracle EE database. -Note that by default the Oracle XE tests are also disabled because the necessary +ojdbc6.jar+ is not publicly available. -Contributors have to upload +ojdbc6.jar+ to a public drive and make it available to the CI job by setting -the +ORACLE_DRIVER_URL+ environment variable in Travis (for more information see Travis -https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings[documentation]). +* +./gradlew dependencies+ to get the list of the dependencies of the selected project, broken down by configuration \ No newline at end of file diff --git a/build.gradle b/build.gradle index c7372e83..efe980d6 100644 --- a/build.gradle +++ b/build.gradle @@ -38,14 +38,6 @@ repositories { maven { url 'http://conjars.org/repo/' } - maven { - url 'http://maven.cubrid.org/' - } - - // DB2 driver repository - maven { - url 'https://artifacts.alfresco.com/nexus/content/repositories/public/' - } } sourceSets { @@ -160,12 +152,6 @@ dependencies { testCompile group: 'org.mockito', name: 'mockito-core', version: mockitoallVersion testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: systemRulesVersion testCompile group: 'org.apache.zookeeper', name: 'zookeeper', version: zookeeperVersion, ext: 'jar' - - // JDBC drivers - 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 } task unitTest (type: Test) { @@ -200,92 +186,6 @@ task thirdPartyTest (type: Test) { systemProperty "ms.datatype.test.hdfsprefix" ,"file:///" } -task postgreSqlTest (type: Test) { - description 'Run Postgresql third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task mySqlTest (type: Test) { - description 'Run MySql third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.MysqlTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task cubridTest (type: Test) { - description 'Run Cubrid third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.CubridTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task db2Test (type: Test) { - description 'Run DB2 third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.Db2Test' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task mainFrameTest (type: Test) { - description 'Run Mainframe third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.MainFrameTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task oracleTest (type: Test) { - description 'Run Oracle third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.OracleTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task oracleXeTest (type: Test) { - description 'Run Oracle third party tests which can be run with Oracle Express Edition too.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.OracleTest' - excludeCategories 'org.apache.sqoop.testcategories.thirdpartytest.OracleEeTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task oracleEeTest (type: Test) { - description 'Run Oracle third party tests which require Oracle Enterprise Edition.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.OracleEeTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } -} - -task sqlServerTest (type: Test) { - description 'Run MS SqlServer third party tests.' - useJUnit { - includeCategories 'org.apache.sqoop.testcategories.thirdpartytest.SqlServerTest' - excludeCategories 'org.apache.sqoop.testcategories.sqooptest.ManualTest' - excludeCategories 'org.apache.sqoop.testcategories.KerberizedTest' - } - systemProperty "ms.datatype.test.data.file.export" ,"DatatypeTestData-export-lite.txt" - systemProperty "ms.datatype.test.data.file.import" ,"DatatypeTestData-import-lite.txt" - systemProperty "ms.datatype.test.data.file.delim" ,"," - systemProperty "ms.datatype.test.hdfsprefix" ,"file:///" -} - test { description 'Run tests that do not need external JDBC driver and/or a docker container. ' + 'This is the same as running unitTest, integrationTest and kerberizedTest.' diff --git a/build.xml b/build.xml index 9245f3e4..a0e25191 100644 --- a/build.xml +++ b/build.xml @@ -185,63 +185,59 @@ value="${name}/[conf]/[artifact]-[revision](-[classifier]).[ext]"/> - - - - - - - + + + + value="jdbc:mysql://localhost/"/> - + value="${env.USER}"/> + + value="sqooptestdb"/> - - - + value="jdbc:cubrid:localhost:30000"/> + + + + value="jdbc:postgresql://localhost/"/> + value="sqooptest" /> + value="sqooptest" /> + value="sqooptest" /> + value="" /> + value="jdbc:sqlserver://sqlserverhost:1433"/> + value="sqooptest"/> + value="SQOOPUSER"/> + value="PASSWORD"/> - + - - + + @@ -839,15 +835,6 @@ - - - - - - @@ -962,7 +949,7 @@ excludes="**/${test.exclude}.java,**/KerberizedTest.java,**/IntegrationTest.java,**/SqoopTest.java, **/UnitTest.java,**/CubridTest.java,**/Db2Test.java,**/MainFrameTest.java,**/MysqlTest.java, **/NetezzaTest.java,**/OracleTest.java,**/PostgresqlTest.java,**/S3Test.java,**/SqlServerTest.java, - **/ThirdPartyTest.java,**/OracleEeTest.java"/> + **/ThirdPartyTest.java"/> diff --git a/gradle.properties b/gradle.properties index 924ce190..722bc8bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -51,11 +51,6 @@ mockitoallVersion=1.9.5 systemRulesVersion=1.17.0 assertjVersion=2.8.0 -mySqlConnectorVersion=5.1.47 -cubridJdbcDriverVersion=10.1.2.7694 -msSqlJdbcDriverVersion=7.0.0.jre8 -db2JdbcDriverVersion=10.1 - checkstyleVersion=5.5 version=1.5.0-SNAPSHOT diff --git a/src/scripts/thirdpartytest/docker-compose/oraclescripts/ee-healthcheck.sh b/src/scripts/thirdpartytest/docker-compose/oraclescripts/ee-healthcheck.sh deleted file mode 100755 index fb7800ef..00000000 --- a/src/scripts/thirdpartytest/docker-compose/oraclescripts/ee-healthcheck.sh +++ /dev/null @@ -1,19 +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. - - -echo "SELECT 1 from DUAL;" | sqlplus -L SQOOPTEST2/ABCDEF@//localhost:1521/sqoop diff --git a/src/scripts/thirdpartytest/docker-compose/oraclescripts/healthcheck.sh b/src/scripts/thirdpartytest/docker-compose/oraclescripts/healthcheck.sh index f5a94963..fb7800ef 100755 --- a/src/scripts/thirdpartytest/docker-compose/oraclescripts/healthcheck.sh +++ b/src/scripts/thirdpartytest/docker-compose/oraclescripts/healthcheck.sh @@ -16,4 +16,4 @@ # limitations under the License. -echo "SELECT 1 from DUAL;" | sqlplus -L SQOOPTEST2/ABCDEF@//localhost:1521/xe +echo "SELECT 1 from DUAL;" | sqlplus -L SQOOPTEST2/ABCDEF@//localhost:1521/sqoop diff --git a/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/.cache b/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/.cache deleted file mode 100644 index b86e7bee..00000000 --- a/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/.cache +++ /dev/null @@ -1,3 +0,0 @@ -d41d8cd98f00b204e9800998ecf8427e - -a941f0f5fbfcb329f646d544d40de691 /docker-entrypoint-initdb.d/oracleusersetup.sql -d41d8cd98f00b204e9800998ecf8427e - 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 d3ffc252..b4cf4886 100644 --- a/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml +++ b/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml @@ -25,7 +25,7 @@ services: MYSQL_PASSWORD: Sqoop12345 MYSQL_DATABASE: sqoop ports: - - 13306:3306 + - 3306:3306 command: mysqld --sql_mode="ANSI_QUOTES" healthcheck: @@ -42,7 +42,7 @@ services: POSTGRES_USER: sqoop POSTGRES_PASSWORD: Sqoop12345 ports: - - 15432:5432 + - 5432:5432 healthcheck: test: ["CMD", "pg_isready"] interval: 30s @@ -77,37 +77,22 @@ services: interval: 30s timeout: 10s retries: 10 - oracle-ee: + oracle: image: oracle/database:12.2.0.1-ee - container_name: sqoop_oracle-ee_container + container_name: sqoop_oracle_container environment: COMPOSE_HTTP_TIMEOUT: 200 ORACLE_SID: sqoop ORACLE_PWD: Sqoop12345 ports: - - 1522:1521 + - 1521:1521 volumes: - ./oraclescripts:/opt/oracle/scripts healthcheck: - test: ["CMD", "/opt/oracle/scripts/ee-healthcheck.sh"] + test: ["CMD", "/opt/oracle/scripts/healthcheck.sh"] interval: 30s timeout: 10s retries: 60 - oracle: - image: sath89/oracle-xe-11g - container_name: sqoop_oracle_container - environment: - COMPOSE_HTTP_TIMEOUT: 200 - ports: - - 1521:1521 - volumes: - - ./oraclescripts:/opt/oracle/scripts - - ./oraclescripts/startup:/docker-entrypoint-initdb.d - healthcheck: - test: ["CMD", "/opt/oracle/scripts/healthcheck.sh"] - interval: 5s - timeout: 5s - retries: 50 db2: image: ibmcom/db2express-c:10.5.0.5-3.10.0 container_name: sqoop_db2_container diff --git a/src/test/org/apache/sqoop/manager/cubrid/CubridTestUtils.java b/src/test/org/apache/sqoop/manager/cubrid/CubridTestUtils.java index 0d95e3d3..4fd522ba 100644 --- a/src/test/org/apache/sqoop/manager/cubrid/CubridTestUtils.java +++ b/src/test/org/apache/sqoop/manager/cubrid/CubridTestUtils.java @@ -51,17 +51,17 @@ public class CubridTestUtils { public static final String HOST_URL = System .getProperty("sqoop.test.cubrid.connectstring.host_url", - "jdbc:cubrid:localhost:33000"); + "jdbc:cubrid:localhost:30000"); static final String TEST_DATABASE = System .getProperty("sqoop.test.cubrid.connectstring.database", - "sqoop"); + "SQOOPCUBRIDTEST"); static final String TEST_USER = System .getProperty("sqoop.test.cubrid.connectstring.username", - "sqoop"); + "SQOOPUSER"); static final String TEST_PASS = System .getProperty("sqoop.test.cubrid.connectstring.password", - "Sqoop12345"); + "PASSWORD"); static final String TABLE_NAME = "EMPLOYEES_CUBRID"; static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_CUBRID"; static final String CONNECT_STRING = HOST_URL + ":" diff --git a/src/test/org/apache/sqoop/manager/db2/DB2ImportAllTableWithSchemaManualTest.java b/src/test/org/apache/sqoop/manager/db2/DB2ImportAllTableWithSchemaManualTest.java index 1f057dcd..ed949b98 100644 --- a/src/test/org/apache/sqoop/manager/db2/DB2ImportAllTableWithSchemaManualTest.java +++ b/src/test/org/apache/sqoop/manager/db2/DB2ImportAllTableWithSchemaManualTest.java @@ -51,10 +51,6 @@ import org.apache.sqoop.util.LoggingUtils; import org.junit.experimental.categories.Category; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; -import static org.apache.sqoop.manager.db2.DB2TestUtils.HOST_URL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -85,8 +81,24 @@ public class DB2ImportAllTableWithSchemaManualTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( DB2ImportAllTableWithSchemaManualTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://9.30.245.234:60000"); + + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "TESTDB"); + static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "DB2FENC1"); + static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "DB2FENC1"); + static final String TABLE_NAME = "TEST.COMPANY"; static final String TABLE_SCHEMA = "TEST"; + static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME; static String ExpectedResults = "1,doc1"; diff --git a/src/test/org/apache/sqoop/manager/db2/DB2ManagerImportManualTest.java b/src/test/org/apache/sqoop/manager/db2/DB2ManagerImportManualTest.java index a32478a5..32dfc5eb 100644 --- a/src/test/org/apache/sqoop/manager/db2/DB2ManagerImportManualTest.java +++ b/src/test/org/apache/sqoop/manager/db2/DB2ManagerImportManualTest.java @@ -44,9 +44,6 @@ import org.apache.sqoop.util.FileListing; import org.junit.experimental.categories.Category; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -77,8 +74,24 @@ public class DB2ManagerImportManualTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( DB2ManagerImportManualTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://db2host:50000"); + + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "SQOOP"); + static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "SQOOP"); + static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "SQOOP"); static final String TABLE_NAME = "EMPLOYEES_DB2"; static final String QUALIFIED_TABLE_NAME = DATABASE_USER + ".EMPLOYEES_DB2"; + static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME + + ":currentSchema=" + DATABASE_USER +";"; static { LOG.info("Using DB2 CONNECT_STRING: " + CONNECT_STRING); diff --git a/src/test/org/apache/sqoop/manager/db2/DB2TestUtils.java b/src/test/org/apache/sqoop/manager/db2/DB2TestUtils.java deleted file mode 100644 index 55a2da85..00000000 --- a/src/test/org/apache/sqoop/manager/db2/DB2TestUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.manager.db2; - -public class DB2TestUtils { - - public static final String HOST_URL = System.getProperty("sqoop.test.db2.connectstring.host_url", "jdbc:db2://localhost:50000"); - public static final String DATABASE_NAME = System.getProperty("sqoop.test.db2.connectstring.database", "SQOOP"); - public static final String DATABASE_USER = System.getProperty("sqoop.test.db2.connectstring.username", "DB2INST1"); - public static final String DATABASE_PASSWORD = System.getProperty("sqoop.test.db2.connectstring.password", "Sqoop12345"); - public static final String CONNECT_STRING = HOST_URL + "/" + DATABASE_NAME + ":currentSchema=" + DATABASE_USER +";"; -} diff --git a/src/test/org/apache/sqoop/manager/db2/DB2XmlTypeImportManualTest.java b/src/test/org/apache/sqoop/manager/db2/DB2XmlTypeImportManualTest.java index 57606383..494c75b0 100644 --- a/src/test/org/apache/sqoop/manager/db2/DB2XmlTypeImportManualTest.java +++ b/src/test/org/apache/sqoop/manager/db2/DB2XmlTypeImportManualTest.java @@ -44,10 +44,6 @@ import org.apache.sqoop.util.FileListing; import org.junit.experimental.categories.Category; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; -import static org.apache.sqoop.manager.db2.DB2TestUtils.HOST_URL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -78,7 +74,23 @@ public class DB2XmlTypeImportManualTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( DB2XmlTypeImportManualTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://db2host:60000"); + + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "SQOOP"); + static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "SQOOP"); + static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "SQOOP"); + static final String TABLE_NAME = "COMPANY"; + static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME; static final String HIVE_TABLE_NAME = "HCOMPANY"; static String ExpectedResults = "1,doc1,Laura BrownFinance"; diff --git a/src/test/org/apache/sqoop/manager/mysql/MySQLTestUtils.java b/src/test/org/apache/sqoop/manager/mysql/MySQLTestUtils.java index a7a6de24..be205c87 100644 --- a/src/test/org/apache/sqoop/manager/mysql/MySQLTestUtils.java +++ b/src/test/org/apache/sqoop/manager/mysql/MySQLTestUtils.java @@ -43,18 +43,18 @@ public final class MySQLTestUtils { private String userName; private String userPass; - private String mysqlDbName; + private String mysqlDbNAme; private String mySqlConnectString; public MySQLTestUtils() { hostUrl = System.getProperty( "sqoop.test.mysql.connectstring.host_url", - "jdbc:mysql://127.0.0.1:13306/"); - userName = System.getProperty("sqoop.test.mysql.username", "sqoop"); - userPass = System.getProperty("sqoop.test.mysql.password", "Sqoop12345"); + "jdbc:mysql://localhost/"); + userName = System.getProperty("sqoop.test.mysql.username", getCurrentUser()); + userPass = System.getProperty("sqoop.test.mysql.password"); - mysqlDbName = System.getProperty("sqoop.test.mysql.databasename", "sqoop"); - mySqlConnectString = getHostUrl() + getMysqlDbName(); + mysqlDbNAme = System.getProperty("sqoop.test.mysql.databasename", "sqooptestdb"); + mySqlConnectString = getHostUrl() + getMysqlDbNAme(); } public String getHostUrl() { @@ -69,8 +69,8 @@ public String getUserPass() { return userPass; } - public String getMysqlDbName() { - return mysqlDbName; + public String getMysqlDbNAme() { + return mysqlDbNAme; } diff --git a/src/test/org/apache/sqoop/manager/oracle/ExportTest.java b/src/test/org/apache/sqoop/manager/oracle/ExportTest.java index 1de12c87..a6016871 100644 --- a/src/test/org/apache/sqoop/manager/oracle/ExportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/ExportTest.java @@ -18,19 +18,15 @@ package org.apache.sqoop.manager.oracle; -import org.apache.sqoop.manager.oracle.util.OracleUtils; -import org.apache.sqoop.testcategories.thirdpartytest.OracleEeTest; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; /** * Test exporting data into Oracle. */ -@Category(OracleEeTest.class) public class ExportTest extends OraOopTestCase { private static final ExportTest TEST_CASE = new ExportTest(); @@ -71,15 +67,4 @@ public static void cleanUpHdfsData() throws Exception { TEST_CASE.closeTestEnvConnection(); } - protected String getConnectString() { - return org.apache.sqoop.manager.oracle.util.OracleUtils.EE_CONNECT_STRING; - } - - protected String getUsername() { - return org.apache.sqoop.manager.oracle.util.OracleUtils.ORACLE_EE_USER_NAME; - } - - protected String getPassword() { - return OracleUtils.ORACLE_EE_USER_PASS; - } } diff --git a/src/test/org/apache/sqoop/manager/oracle/ImportTest.java b/src/test/org/apache/sqoop/manager/oracle/ImportTest.java index bd5f3733..5db9fe34 100644 --- a/src/test/org/apache/sqoop/manager/oracle/ImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/ImportTest.java @@ -21,17 +21,13 @@ import org.apache.hadoop.conf.Configuration; import org.apache.sqoop.manager.oracle.OraOopConstants. OraOopOracleDataChunkMethod; -import org.apache.sqoop.manager.oracle.util.OracleUtils; -import org.apache.sqoop.testcategories.thirdpartytest.OracleEeTest; import org.junit.Test; -import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; /** * Test import data from Oracle. */ -@Category(OracleEeTest.class) public class ImportTest extends OraOopTestCase { private static final boolean DISABLE_ORACLE_ESCAPING_FLAG = false; @@ -279,15 +275,4 @@ public void testProductPartIotImport() throws Exception { } } - protected String getConnectString() { - return OracleUtils.EE_CONNECT_STRING; - } - - protected String getUsername() { - return OracleUtils.ORACLE_EE_USER_NAME; - } - - protected String getPassword() { - return OracleUtils.ORACLE_EE_USER_PASS; - } } diff --git a/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java b/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java index 796a6e78..1598813d 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java +++ b/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java @@ -108,7 +108,9 @@ protected void setSqoopGenClassName(String sqoopGenClassName) { protected Connection getTestEnvConnection() throws SQLException { if (this.conn == null) { - this.conn = DriverManager.getConnection(getConnectString(), getUsername(), getPassword()); + this.conn = + DriverManager.getConnection(OracleUtils.CONNECT_STRING, + OracleUtils.ORACLE_USER_NAME, OracleUtils.ORACLE_USER_PASS); this.conn.setAutoCommit(false); } return this.conn; @@ -229,13 +231,13 @@ protected int runImport(String tableName, Configuration sqoopConf, } sqoopArgs.add("--connect"); - sqoopArgs.add(getConnectString()); + sqoopArgs.add(OracleUtils.CONNECT_STRING); sqoopArgs.add("--username"); - sqoopArgs.add(getUsername()); + sqoopArgs.add(OracleUtils.ORACLE_USER_NAME); sqoopArgs.add("--password"); - sqoopArgs.add(getPassword()); + sqoopArgs.add(OracleUtils.ORACLE_USER_PASS); sqoopArgs.add("--table"); sqoopArgs.add(tableName); @@ -307,13 +309,13 @@ protected int runExport(String tableName, List additionalArgs, Map jdbcFetchSize * 1.075) { + if (rowsPerFetch < jdbcFetchSize * 0.95 + || rowsPerFetch > jdbcFetchSize * 1.05) { Assert .fail(String .format( diff --git a/src/test/org/apache/sqoop/manager/oracle/TimestampDataTest.java b/src/test/org/apache/sqoop/manager/oracle/TimestampDataTest.java index adfd9b67..be086c5c 100644 --- a/src/test/org/apache/sqoop/manager/oracle/TimestampDataTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/TimestampDataTest.java @@ -19,10 +19,7 @@ package org.apache.sqoop.manager.oracle; import org.apache.hadoop.conf.Configuration; -import org.apache.sqoop.manager.oracle.util.OracleUtils; -import org.apache.sqoop.testcategories.thirdpartytest.OracleEeTest; import org.junit.Test; -import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; @@ -31,7 +28,6 @@ * requires the tests to be run in a different process. Maven needs to be setup * to fork per test class. */ -@Category(OracleEeTest.class) public class TimestampDataTest extends OraOopTestCase { private static final boolean DISABLE_ORACLE_ESCAPING_FLAG = false; @@ -54,15 +50,4 @@ public void testProductImportTimezone() throws Exception { } } - protected String getConnectString() { - return org.apache.sqoop.manager.oracle.util.OracleUtils.EE_CONNECT_STRING; - } - - protected String getUsername() { - return org.apache.sqoop.manager.oracle.util.OracleUtils.ORACLE_EE_USER_NAME; - } - - protected String getPassword() { - return OracleUtils.ORACLE_EE_USER_PASS; - } } diff --git a/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java b/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java index 9c65e3d8..14b57f91 100644 --- a/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java +++ b/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java @@ -36,13 +36,12 @@ public final class OracleUtils { public static final Log LOG = LogFactory.getLog(OracleUtils.class.getName()); - public static final String CONNECT_STRING = System.getProperty("sqoop.test.oracle.connectstring", "jdbc:oracle:thin:@//localhost:1521/xe"); - public static final String ORACLE_USER_NAME = System.getProperty("sqoop.test.oracle.username", "SYSTEM"); - public static final String ORACLE_USER_PASS = System.getProperty("sqoop.test.oracle.password", "oracle"); + // Express edition hardcoded name. + public static final String ORACLE_DATABASE_NAME = "xe"; - public static final String EE_CONNECT_STRING = System.getProperty("sqoop.test.oracle-ee.connectstring", "jdbc:oracle:thin:@//localhost:1522/sqoop"); - public static final String ORACLE_EE_USER_NAME = System.getProperty("sqoop.test.oracle-ee.username", "SYSTEM"); - public static final String ORACLE_EE_USER_PASS = System.getProperty("sqoop.test.oracle-ee.password", "Sqoop12345"); + public static final String CONNECT_STRING = System.getProperty("sqoop.test.oracle.connectstring", "jdbc:oracle:thin:@//localhost/" + ORACLE_DATABASE_NAME); + public static final String ORACLE_USER_NAME = System.getProperty("sqoop.test.oracle.username", "SQOOPTEST"); + public static final String ORACLE_USER_PASS = System.getProperty("sqoop.test.oracle.password", "12345"); public static final String ORACLE_SECONDARY_USER_NAME = "SQOOPTEST2"; public static final String ORACLE_SECONDARY_USER_PASS = "ABCDEF"; diff --git a/src/test/org/apache/sqoop/manager/postgresql/DirectPostgreSQLExportManualTest.java b/src/test/org/apache/sqoop/manager/postgresql/DirectPostgreSQLExportManualTest.java index 9f8dd201..7dd6efcf 100644 --- a/src/test/org/apache/sqoop/manager/postgresql/DirectPostgreSQLExportManualTest.java +++ b/src/test/org/apache/sqoop/manager/postgresql/DirectPostgreSQLExportManualTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.manager.postgresql; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; - import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; @@ -67,6 +63,17 @@ public class DirectPostgreSQLExportManualTest extends TestExport { LogFactory.getLog(DirectPostgreSQLExportManualTest.class.getName()); private DBConfiguration dbConf; + static final String HOST_URL = + System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + static final String DATABASE = + System.getProperty("sqoop.test.postgresql.database", "sqooptest"); + static final String USERNAME = + System.getProperty("sqoop.test.postgresql.username", "sqooptest"); + static final String PASSWORD = System.getProperty( + "sqoop.test.postgresql.password"); + static final String CONNECT_STRING = HOST_URL + DATABASE; + public DirectPostgreSQLExportManualTest() { JobConf conf = new JobConf(getConf()); DBConfiguration.configureDB(conf, @@ -88,7 +95,7 @@ protected String getConnectString() { } protected String getUserName() { - return DATABASE_USER; + return USERNAME; } @Override diff --git a/src/test/org/apache/sqoop/manager/postgresql/PGBulkloadManagerManualTest.java b/src/test/org/apache/sqoop/manager/postgresql/PGBulkloadManagerManualTest.java index 88490228..1fe26445 100644 --- a/src/test/org/apache/sqoop/manager/postgresql/PGBulkloadManagerManualTest.java +++ b/src/test/org/apache/sqoop/manager/postgresql/PGBulkloadManagerManualTest.java @@ -18,9 +18,6 @@ package org.apache.sqoop.manager.postgresql; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; - import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; @@ -74,10 +71,18 @@ public class PGBulkloadManagerManualTest extends TestExport { public static final Log LOG = LogFactory.getLog(PGBulkloadManagerManualTest.class.getName()); private DBConfiguration dbConf; + static final String HOST_URL = + System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + static final String DATABASE = + System.getProperty("sqoop.test.postgresql.database", "sqooptest"); static final String TABLESPACE = - System.getProperty("sqoop.test.postgresql.tablespace", "sqoop"); + System.getProperty("sqoop.test.postgresql.tablespace", "sqooptest"); + static final String USERNAME = + System.getProperty("sqoop.test.postgresql.username", "sqooptest"); static final String PG_BULKLOAD = System.getProperty("sqoop.test.postgresql.pg_bulkload", "pg_bulkload"); + static final String CONNECT_STRING = HOST_URL + DATABASE; public PGBulkloadManagerManualTest() { JobConf conf = new JobConf(getConf()); @@ -103,7 +108,7 @@ protected String getConnectString() { protected String getUserName() { - return DATABASE_USER; + return USERNAME; } diff --git a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExportTest.java b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExportTest.java index 457b398a..eb798fa9 100644 --- a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExportTest.java +++ b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExportTest.java @@ -17,10 +17,6 @@ */ package org.apache.sqoop.manager.postgresql; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; - import org.apache.sqoop.SqoopOptions; import org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest; import org.apache.sqoop.testutil.CommonArgs; @@ -56,11 +52,24 @@ public class PostgresqlExportTest extends ExportJobTestCase { public static final Log LOG = LogFactory.getLog( PostgresqlExportTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + static final String DATABASE_USER = System.getProperty( + "sqoop.test.postgresql.username", + "sqooptest"); + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.postgresql.database", + "sqooptest"); + static final String PASSWORD = System.getProperty( + "sqoop.test.postgresql.password"); + static final String TABLE_NAME = "EMPLOYEES_PG"; static final String PROCEDURE_NAME = "INSERT_AN_EMPLOYEE"; static final String STAGING_TABLE_NAME = "STAGING"; static final String SCHEMA_PUBLIC = "public"; static final String SCHEMA_SPECIAL = "special"; + static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; protected Connection connection; diff --git a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExternalTableImportTest.java b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExternalTableImportTest.java index c089291d..8c3d2fd9 100644 --- a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExternalTableImportTest.java +++ b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlExternalTableImportTest.java @@ -17,9 +17,6 @@ */ package org.apache.sqoop.manager.postgresql; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -57,6 +54,13 @@ public class PostgresqlExternalTableImportTest extends ImportJobTestCase { public static final Log LOG = LogFactory .getLog(PostgresqlExternalTableImportTest.class.getName()); + static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + static final String DATABASE_USER = System.getProperty( + "sqoop.test.postgresql.username", "sqooptest"); + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.postgresql.database", "sqooptest"); + static final String PASSWORD = System.getProperty("sqoop.test.postgresql.password"); static final String TABLE_NAME = "EMPLOYEES_PG"; static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_PG"; @@ -64,6 +68,7 @@ public class PostgresqlExternalTableImportTest extends ImportJobTestCase { static final String DIFFERENT_TABLE_NAME = "DIFFERENT_TABLE"; static final String SCHEMA_PUBLIC = "public"; static final String SCHEMA_SPECIAL = "special"; + static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; static final String EXTERNAL_TABLE_DIR = "/tmp/external/employees_pg"; protected Connection connection; diff --git a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlTestUtil.java b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlTestUtil.java index 146e4b3c..e9705e5d 100644 --- a/src/test/org/apache/sqoop/manager/postgresql/PostgresqlTestUtil.java +++ b/src/test/org/apache/sqoop/manager/postgresql/PostgresqlTestUtil.java @@ -22,20 +22,20 @@ public class PostgresqlTestUtil { public static final String HOST_URL = System.getProperty( "sqoop.test.postgresql.connectstring.host_url", - "jdbc:postgresql://localhost:15432/"); + "jdbc:postgresql://localhost/"); public static final String DATABASE_USER = System.getProperty( "sqoop.test.postgresql.username", - "sqoop"); + "sqooptest"); public static final String DATABASE_NAME = System.getProperty( "sqoop.test.postgresql.database", - "sqoop"); + "sqooptest"); public static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; public static final String PASSWORD = System.getProperty( - "sqoop.test.postgresql.password", "Sqoop12345"); + "sqoop.test.postgresql.password"); static final String TABLE_NAME = "EMPLOYEES_PG"; diff --git a/src/test/org/apache/sqoop/manager/sqlserver/MSSQLTestUtils.java b/src/test/org/apache/sqoop/manager/sqlserver/MSSQLTestUtils.java index 401d2faf..bd12c556 100644 --- a/src/test/org/apache/sqoop/manager/sqlserver/MSSQLTestUtils.java +++ b/src/test/org/apache/sqoop/manager/sqlserver/MSSQLTestUtils.java @@ -38,15 +38,15 @@ public class MSSQLTestUtils { MSSQLTestUtils.class.getName()); public static final String DATABASE_USER = System.getProperty( - "ms.sqlserver.username", "sa"); + "ms.sqlserver.username", "SQOOPUSER"); public static final String DATABASE_PASSWORD = System.getProperty( - "ms.sqlserver.password", "Sqoop12345"); + "ms.sqlserver.password", "PASSWORD"); public static final String DATABASE_NAME = System.getProperty( "sqoop.test.sqlserver.database", - "master"); + "sqooptest"); public static final String HOST_URL = System.getProperty( "sqoop.test.sqlserver.connectstring.host_url", - "jdbc:sqlserver://localhost:1433"); + "jdbc:sqlserver://sqlserverhost:1433"); public static final String CONNECT_STRING = HOST_URL + ";database=" + DATABASE_NAME; diff --git a/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerExportTest.java b/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerExportTest.java index 9d019a83..ab1e8ff2 100644 --- a/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerExportTest.java +++ b/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerExportTest.java @@ -42,10 +42,6 @@ import java.sql.Statement; import java.util.ArrayList; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_NAME; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_USER; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.HOST_URL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -58,6 +54,19 @@ public class SQLServerManagerExportTest extends ExportJobTestCase { public static final Log LOG = LogFactory.getLog( SQLServerManagerExportTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.sqlserver.connectstring.host_url", + "jdbc:sqlserver://sqlserverhost:1433"); + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.sqlserver.database", + "sqooptest"); + static final String DATABASE_USER = System.getProperty( + "ms.sqlserver.username", + "sqoopuser"); + static final String DATABASE_PASSWORD = System.getProperty( + "ms.sqlserver.password", + "password"); + static final String SCHEMA_DBO = "dbo"; static final String DBO_TABLE_NAME = "EMPLOYEES_MSSQL"; static final String DBO_BINARY_TABLE_NAME = "BINARYTYPE_MSSQL"; diff --git a/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerImportTest.java b/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerImportTest.java index 42ac7661..3c5bb327 100644 --- a/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerImportTest.java +++ b/src/test/org/apache/sqoop/manager/sqlserver/SQLServerManagerImportTest.java @@ -52,10 +52,6 @@ import java.sql.Statement; import java.util.Arrays; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_NAME; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_USER; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.sqlserver.MSSQLTestUtils.HOST_URL; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -90,6 +86,19 @@ public class SQLServerManagerImportTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( SQLServerManagerImportTest.class.getName()); + static final String HOST_URL = System.getProperty( + "sqoop.test.sqlserver.connectstring.host_url", + "jdbc:sqlserver://sqlserverhost:1433"); + static final String DATABASE_NAME = System.getProperty( + "sqoop.test.sqlserver.database", + "sqooptest"); + static final String DATABASE_USER = System.getProperty( + "ms.sqlserver.username", + "sqoopuser"); + static final String DATABASE_PASSWORD = System.getProperty( + "ms.sqlserver.password", + "password"); + static final String SCHEMA_DBO = "dbo"; static final String DBO_TABLE_NAME = "EMPLOYEES_MSSQL"; static final String SCHEMA_SCH = "sch"; diff --git a/src/test/org/apache/sqoop/metastore/db2/DB2JobToolTest.java b/src/test/org/apache/sqoop/metastore/db2/DB2JobToolTest.java index 578c6040..81ef5fce 100644 --- a/src/test/org/apache/sqoop/metastore/db2/DB2JobToolTest.java +++ b/src/test/org/apache/sqoop/metastore/db2/DB2JobToolTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.db2; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; - import org.apache.sqoop.metastore.JobToolTestBase; import org.apache.sqoop.testcategories.thirdpartytest.Db2Test; import org.junit.experimental.categories.Category; @@ -48,6 +44,23 @@ @Category(Db2Test.class) public class DB2JobToolTest extends JobToolTestBase { + private static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://db2host:50000"); + + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "SQOOP"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "SQOOP"); + private static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "SQOOP"); + private static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME + + ":currentSchema=" + DATABASE_USER +";"; + public DB2JobToolTest() { super(CONNECT_STRING, DATABASE_USER, DATABASE_PASSWORD); } diff --git a/src/test/org/apache/sqoop/metastore/db2/DB2MetaConnectIncrementalImportTest.java b/src/test/org/apache/sqoop/metastore/db2/DB2MetaConnectIncrementalImportTest.java index 08baec8c..5403908e 100644 --- a/src/test/org/apache/sqoop/metastore/db2/DB2MetaConnectIncrementalImportTest.java +++ b/src/test/org/apache/sqoop/metastore/db2/DB2MetaConnectIncrementalImportTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.db2; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; - import org.apache.sqoop.metastore.MetaConnectIncrementalImportTestBase; import org.apache.sqoop.testcategories.thirdpartytest.Db2Test; import org.junit.experimental.categories.Category; @@ -48,6 +44,23 @@ @Category(Db2Test.class) public class DB2MetaConnectIncrementalImportTest extends MetaConnectIncrementalImportTestBase { + private static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://db2host:50000"); + + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "SQOOP"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "SQOOP"); + private static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "SQOOP"); + private static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME + + ":currentSchema=" + DATABASE_USER +";"; + public DB2MetaConnectIncrementalImportTest() { super(CONNECT_STRING, DATABASE_USER, DATABASE_PASSWORD); } diff --git a/src/test/org/apache/sqoop/metastore/db2/DB2SavedJobsTest.java b/src/test/org/apache/sqoop/metastore/db2/DB2SavedJobsTest.java index ca5d87d4..b41eda11 100644 --- a/src/test/org/apache/sqoop/metastore/db2/DB2SavedJobsTest.java +++ b/src/test/org/apache/sqoop/metastore/db2/DB2SavedJobsTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.db2; -import static org.apache.sqoop.manager.db2.DB2TestUtils.CONNECT_STRING; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_PASSWORD; -import static org.apache.sqoop.manager.db2.DB2TestUtils.DATABASE_USER; - import org.apache.sqoop.metastore.SavedJobsTestBase; import org.apache.sqoop.manager.JdbcDrivers; import org.apache.sqoop.testcategories.thirdpartytest.Db2Test; @@ -49,6 +45,23 @@ @Category(Db2Test.class) public class DB2SavedJobsTest extends SavedJobsTestBase { + private static final String HOST_URL = System.getProperty( + "sqoop.test.db2.connectstring.host_url", + "jdbc:db2://db2host:50000"); + + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.db2.connectstring.database", + "SQOOP"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.db2.connectstring.username", + "SQOOP"); + private static final String DATABASE_PASSWORD = System.getProperty( + "sqoop.test.db2.connectstring.password", + "SQOOP"); + private static final String CONNECT_STRING = HOST_URL + + "/" + DATABASE_NAME + + ":currentSchema=" + DATABASE_USER +";"; + public DB2SavedJobsTest() { super(CONNECT_STRING, DATABASE_USER, DATABASE_PASSWORD, JdbcDrivers.DB2.getDriverClass()); } diff --git a/src/test/org/apache/sqoop/metastore/postgres/PostgresJobToolTest.java b/src/test/org/apache/sqoop/metastore/postgres/PostgresJobToolTest.java index bc74abd1..59ea151a 100644 --- a/src/test/org/apache/sqoop/metastore/postgres/PostgresJobToolTest.java +++ b/src/test/org/apache/sqoop/metastore/postgres/PostgresJobToolTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.postgres; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; - import org.apache.sqoop.metastore.JobToolTestBase; import org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest; import org.junit.experimental.categories.Category; @@ -44,6 +40,15 @@ @Category(PostgresqlTest.class) public class PostgresJobToolTest extends JobToolTestBase { + private static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.postgresql.username", "sqooptest"); + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.postgresql.database", "sqooptest"); + private static final String PASSWORD = System.getProperty("sqoop.test.postgresql.password"); + private static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; + public PostgresJobToolTest() { super(CONNECT_STRING, DATABASE_USER, PASSWORD); } diff --git a/src/test/org/apache/sqoop/metastore/postgres/PostgresMetaConnectIncrementalImportTest.java b/src/test/org/apache/sqoop/metastore/postgres/PostgresMetaConnectIncrementalImportTest.java index 648333a3..afc6bd23 100644 --- a/src/test/org/apache/sqoop/metastore/postgres/PostgresMetaConnectIncrementalImportTest.java +++ b/src/test/org/apache/sqoop/metastore/postgres/PostgresMetaConnectIncrementalImportTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.postgres; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; - import org.apache.sqoop.metastore.MetaConnectIncrementalImportTestBase; import org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest; import org.junit.experimental.categories.Category; @@ -44,6 +40,15 @@ @Category(PostgresqlTest.class) public class PostgresMetaConnectIncrementalImportTest extends MetaConnectIncrementalImportTestBase { + private static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.postgresql.username", "sqooptest"); + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.postgresql.database", "sqooptest"); + private static final String PASSWORD = System.getProperty("sqoop.test.postgresql.password"); + private static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; + public PostgresMetaConnectIncrementalImportTest() { super(CONNECT_STRING, DATABASE_USER, PASSWORD); } diff --git a/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java b/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java index 7b1559d8..9f9e865b 100644 --- a/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java +++ b/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java @@ -18,10 +18,6 @@ package org.apache.sqoop.metastore.postgres; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.CONNECT_STRING; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.DATABASE_USER; -import static org.apache.sqoop.manager.postgresql.PostgresqlTestUtil.PASSWORD; - import org.apache.sqoop.metastore.SavedJobsTestBase; import org.apache.sqoop.manager.JdbcDrivers; import org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest; @@ -45,6 +41,15 @@ @Category(PostgresqlTest.class) public class PostgresSavedJobsTest extends SavedJobsTestBase { + private static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); + private static final String DATABASE_USER = System.getProperty( + "sqoop.test.postgresql.username", "sqooptest"); + private static final String DATABASE_NAME = System.getProperty( + "sqoop.test.postgresql.database", "sqooptest"); + private static final String PASSWORD = System.getProperty("sqoop.test.postgresql.password"); + private static final String CONNECT_STRING = HOST_URL + DATABASE_NAME; + public PostgresSavedJobsTest() { super(CONNECT_STRING, DATABASE_USER, PASSWORD, JdbcDrivers.POSTGRES.getDriverClass()); } diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleEeTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleEeTest.java deleted file mode 100644 index c2063f8f..00000000 --- a/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleEeTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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.testcategories.thirdpartytest; - -/** - * An Oracle EE test shall test scenarios where a Oracle Enterprise Edition database is needed, - * for example because of partitioning. - */ -public interface OracleEeTest extends OracleTest { -}