sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject [sqoop] branch trunk updated: SQOOP-3428: Fix the CI
Date Fri, 08 Mar 2019 15:28:46 GMT
This is an automated email from the ASF dual-hosted git repository.

fero pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/sqoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 20fe120  SQOOP-3428: Fix the CI
20fe120 is described below

commit 20fe120706039adbf7e58985f93b2020f688abc0
Author: Fokko Driesprong <fokko@driesprong.frl>
AuthorDate: Fri Mar 8 16:28:41 2019 +0100

    SQOOP-3428: Fix the CI
    
    (Fokko Driesprong via Fero Szabo)
---
 .../oraclescripts/startup/oracleusersetup.sql      |  2 +-
 .../sqoop-thirdpartytest-db-services.yml           |  3 ++-
 .../sqoop/manager/oracle/OracleCompatTest.java     | 24 +++++++++-------------
 .../sqoop/manager/oracle/OracleManagerTest.java    | 16 ++++++++-------
 .../sqoop/manager/oracle/util/OracleUtils.java     |  3 ---
 .../sqoop/testutil/ManagerCompatTestCase.java      |  6 ++----
 6 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/oracleusersetup.sql
b/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/oracleusersetup.sql
index 8ef9f8b..25e0d43 100644
--- a/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/oracleusersetup.sql
+++ b/src/scripts/thirdpartytest/docker-compose/oraclescripts/startup/oracleusersetup.sql
@@ -15,5 +15,5 @@
 
 ALTER SESSION SET "_ORACLE_SCRIPT"=true;
 CREATE USER SQOOPTEST2 identified by ABCDEF;
-GRANT CONNECT, RESOURCE to SQOOPTEST2;
+GRANT CONNECT, RESOURCE, DBA to SQOOPTEST2;
 ALTER USER SQOOPTEST2 quota unlimited on USERS;
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 d3ffc25..0754c9c 100644
--- a/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml
+++ b/src/scripts/thirdpartytest/docker-compose/sqoop-thirdpartytest-db-services.yml
@@ -94,10 +94,11 @@ services:
       timeout: 10s
       retries: 60
   oracle:
-      image: sath89/oracle-xe-11g
+      image: acktsw/oracle-xe-11g
       container_name: sqoop_oracle_container
       environment:
         COMPOSE_HTTP_TIMEOUT: 200
+        DEFAULT_SYS_PASS: oracle
       ports:
         - 1521:1521
       volumes:
diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleCompatTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleCompatTest.java
index 3878fc8..850a842 100644
--- a/src/test/org/apache/sqoop/manager/oracle/OracleCompatTest.java
+++ b/src/test/org/apache/sqoop/manager/oracle/OracleCompatTest.java
@@ -192,11 +192,11 @@ public class OracleCompatTest extends ManagerCompatTestCase {
   }
 
   protected String getBinaryFloatInsertStr(float f) {
-    return "TO_BINARY_FLOAT('" + f + "')";
+    return "TO_BINARY_FLOAT(" + f + "F)";
   }
 
   protected String getBinaryDoubleInsertStr(double d) {
-    return "TO_BINARY_DOUBLE('" + d + "')";
+    return "TO_BINARY_DOUBLE(" + d + "D)";
   }
 
   // Disable this test since Oracle isn't ANSI compliant.
@@ -249,24 +249,20 @@ public class OracleCompatTest extends ManagerCompatTestCase {
     verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(+6.34f), "6.34");
 
     // Max and min are from Oracle DB SQL reference for 10g release 2
-    float max = 3.40282E+38F;
-    verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(max), "3.40282E38");
-    float min = 1.17549E-38F;
-    verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(min), "1.17549E-38");
+    // https://stackoverflow.com/questions/3884793/why-is-double-min-value-in-not-negative
+    verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(Float.MAX_VALUE), "3.4028235E38");
+    verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(-Float.MAX_VALUE), "-3.4028235E38");
   }
 
   @Test
   public void testBinaryDouble() {
-    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(0.5d), "0.5");
-    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-1d), "-1.0");
+    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(0.5), "0.5");
+    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-1), "-1.0");
 
     // Max and min are from Oracle DB SQL reference for 10g release 2
-    double max = 1.79769313486231E+308;
-    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(max),
-        "1.79769313486231E308");
-    double min = 2.22507485850720E-308;
-    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(min),
-        "2.2250748585072E-308");
+    // https://stackoverflow.com/questions/3884793/why-is-double-min-value-in-not-negative
+    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(Double.MAX_VALUE), "1.7976931348623157E308");
+    verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-Double.MAX_VALUE), "-1.7976931348623157E308");
   }
 }
 
diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleManagerTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleManagerTest.java
index 8a5b3cc..b9dc3ec 100644
--- a/src/test/org/apache/sqoop/manager/oracle/OracleManagerTest.java
+++ b/src/test/org/apache/sqoop/manager/oracle/OracleManagerTest.java
@@ -130,16 +130,16 @@ public class OracleManagerTest extends ImportJobTestCase {
               + "PRIMARY KEY (id))",
       "INSERT INTO " + TABLE_NAME + " VALUES("
               + "1,'Aaron',to_date('2009-05-14','yyyy-mm-dd'),"
-              + "1000000.00,'engineering','29-DEC-09 12.00.00.000000000 PM',"
-              + "'29-DEC-09 12.00.00.000000000 PM')",
+              + "1000000.00,'engineering',TO_TIMESTAMP('29-DEC-09 12.00.00.000000000 PM',
'DD-MON-RR HH12.MI.SS.FF PM'),"
+              + "TO_TIMESTAMP('29-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF
PM'))",
       "INSERT INTO " + TABLE_NAME + " VALUES("
               + "2,'Bob',to_date('2009-04-20','yyyy-mm-dd'),"
-              + "400.00,'sales','30-DEC-09 12.00.00.000000000 PM',"
-              + "'30-DEC-09 12.00.00.000000000 PM')",
+              + "400.00,'sales',TO_TIMESTAMP('30-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR
HH12.MI.SS.FF PM'),"
+              + "TO_TIMESTAMP('30-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF
PM'))",
       "INSERT INTO " + TABLE_NAME + " VALUES("
               + "3,'Fred',to_date('2009-01-23','yyyy-mm-dd'),15.00,"
-              + "'marketing','31-DEC-09 12.00.00.000000000 PM',"
-              + "'31-DEC-09 12.00.00.000000000 PM')",
+              + "'marketing', TO_TIMESTAMP('31-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR
HH12.MI.SS.FF PM'),"
+              + "TO_TIMESTAMP('31-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF
PM'))",
   };
 
   /*
@@ -258,7 +258,9 @@ public class OracleManagerTest extends ImportJobTestCase {
   public void tearDown() {
     super.tearDown();
     try {
-      manager.close();
+      if(manager != null) {
+        manager.close();
+      }
     } catch (SQLException sqlE) {
       LOG.error("Got SQLException: " + sqlE.toString());
       fail("Got SQLException: " + sqlE.toString());
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 9c65e3d..95dedf9 100644
--- a/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java
+++ b/src/test/org/apache/sqoop/manager/oracle/util/OracleUtils.java
@@ -53,9 +53,6 @@ public final class OracleUtils {
   public static final int INTEGRATIONTEST_NUM_ROWS = 10000;
   // Number of mappers if wanting to override default setting
   public static final int NUM_MAPPERS = 0;
-  // Oracle degree of parallelism to use when creating table.
-  // If 0 we will calculate a recommended value
-  public static final int ORACLE_PARALLEL_DEGREE = 0;
 
   private OracleUtils() { }
 
diff --git a/src/test/org/apache/sqoop/testutil/ManagerCompatTestCase.java b/src/test/org/apache/sqoop/testutil/ManagerCompatTestCase.java
index 248e100..44d9fd1 100644
--- a/src/test/org/apache/sqoop/testutil/ManagerCompatTestCase.java
+++ b/src/test/org/apache/sqoop/testutil/ManagerCompatTestCase.java
@@ -490,13 +490,11 @@ public abstract class ManagerCompatTestCase extends ImportJobTestCase
{
    *        different than what ResultSet.getString() returns, which is used
    *        by returnVal.
    */
-  protected void verifyType(String colType, String insertVal,
-      String seqFileVal) {
+  protected void verifyType(String colType, String insertVal, String seqFileVal) {
     verifyType(colType, insertVal, seqFileVal, false);
   }
 
-  protected void verifyType(String colType, String insertVal, String seqFileVal,
-      boolean useIntPrimaryKey) {
+  protected void verifyType(String colType, String insertVal, String seqFileVal, boolean
useIntPrimaryKey) {
 
     String readbackPrepend = "";
 


Mime
View raw message