You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by an...@apache.org on 2017/03/16 19:38:16 UTC

sqoop git commit: SQOOP-3143: Restore fail messages removed in SQOOP-3091

Repository: sqoop
Updated Branches:
  refs/heads/trunk 1a8fe23d7 -> ac5ca7c02


SQOOP-3143: Restore fail messages removed in SQOOP-3091

(Boglarka Egyed via Anna Szonyi)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/ac5ca7c0
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/ac5ca7c0
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/ac5ca7c0

Branch: refs/heads/trunk
Commit: ac5ca7c02195a878646cd0172bfb2ced83ddd6f1
Parents: 1a8fe23
Author: Anna Szonyi <an...@apache.org>
Authored: Thu Mar 16 20:23:57 2017 +0100
Committer: Anna Szonyi <an...@apache.org>
Committed: Thu Mar 16 20:23:57 2017 +0100

----------------------------------------------------------------------
 src/test/com/cloudera/sqoop/TestAvroExport.java      |  3 +++
 src/test/com/cloudera/sqoop/TestConnFactory.java     |  1 +
 src/test/com/cloudera/sqoop/TestExportUpdate.java    |  1 +
 src/test/com/cloudera/sqoop/TestParquetExport.java   |  3 +++
 src/test/com/cloudera/sqoop/TestSqoopOptions.java    | 15 +++++++++++++++
 src/test/com/cloudera/sqoop/TestTargetDir.java       |  2 ++
 .../org/apache/sqoop/TestExportUsingProcedure.java   |  2 ++
 7 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestAvroExport.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestAvroExport.java b/src/test/com/cloudera/sqoop/TestAvroExport.java
index 487c12b..ea456e2 100644
--- a/src/test/com/cloudera/sqoop/TestAvroExport.java
+++ b/src/test/com/cloudera/sqoop/TestAvroExport.java
@@ -448,6 +448,7 @@ public class TestAvroExport extends ExportJobTestCase {
     createTable(gen);
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception as Avro records are not supported");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 
@@ -477,6 +478,7 @@ public class TestAvroExport extends ExportJobTestCase {
     createTableWithInsert();
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception during Avro export with --update-mode");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 
@@ -504,6 +506,7 @@ public class TestAvroExport extends ExportJobTestCase {
     createTable(gen);
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception on missing Avro fields");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestConnFactory.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestConnFactory.java b/src/test/com/cloudera/sqoop/TestConnFactory.java
index 62035cb..b362e49 100644
--- a/src/test/com/cloudera/sqoop/TestConnFactory.java
+++ b/src/test/com/cloudera/sqoop/TestConnFactory.java
@@ -69,6 +69,7 @@ public class TestConnFactory {
     ConnFactory factory = new ConnFactory(conf);
 
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException because of missing ConnManager ");
     factory.getManager(
         new JobData(new SqoopOptions(), new ImportTool()));
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestExportUpdate.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestExportUpdate.java b/src/test/com/cloudera/sqoop/TestExportUpdate.java
index 81f3a68..683f591 100644
--- a/src/test/com/cloudera/sqoop/TestExportUpdate.java
+++ b/src/test/com/cloudera/sqoop/TestExportUpdate.java
@@ -702,6 +702,7 @@ public class TestExportUpdate extends ExportJobTestCase {
     populateDatabase(1);
 
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException as --columns is not a superset of --update-key");
     runExport(getArgv(true, 2, 2, "-m", "1",
         "--update-key", "A", "--columns", "B"));
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestParquetExport.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestParquetExport.java b/src/test/com/cloudera/sqoop/TestParquetExport.java
index 3c3db33..680fd73 100644
--- a/src/test/com/cloudera/sqoop/TestParquetExport.java
+++ b/src/test/com/cloudera/sqoop/TestParquetExport.java
@@ -396,6 +396,7 @@ public class TestParquetExport extends ExportJobTestCase {
     createTable(gen);
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception as Parquet records are not supported");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 
@@ -435,6 +436,7 @@ public class TestParquetExport extends ExportJobTestCase {
     createTableWithInsert();
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception during Parquet export with --update-mode");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 
@@ -449,6 +451,7 @@ public class TestParquetExport extends ExportJobTestCase {
     createTable(gen);
 
     thrown.expect(Exception.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception on missing Parquet fields");
     runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1)));
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestSqoopOptions.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestSqoopOptions.java b/src/test/com/cloudera/sqoop/TestSqoopOptions.java
index 7d34d33..0b33b24 100644
--- a/src/test/com/cloudera/sqoop/TestSqoopOptions.java
+++ b/src/test/com/cloudera/sqoop/TestSqoopOptions.java
@@ -74,12 +74,14 @@ public class TestSqoopOptions {
   @Test
   public void testEmptyString() throws Exception {
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on empty string");
     SqoopOptions.toChar("");
   }
 
   @Test
   public void testNullString() throws Exception {
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on null string");
     SqoopOptions.toChar(null);
   }
 
@@ -134,12 +136,14 @@ public class TestSqoopOptions {
   @Test
   public void testUnknownEscape1() throws Exception {
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on unknown escaping");
     SqoopOptions.toChar("\\Q");
   }
 
   @Test
   public void testUnknownEscape2() throws Exception {
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on unknown escaping");
     SqoopOptions.toChar("\\nn");
   }
 
@@ -176,12 +180,14 @@ public class TestSqoopOptions {
   @Test
   public void testErrOctalChar() throws Exception {
     thrown.expect(NumberFormatException.class);
+    thrown.reportMissingExceptionWithMessage("Expected NumberFormatException on erroneous octal char");
     SqoopOptions.toChar("\\095");
   }
 
   @Test
   public void testErrHexChar() throws Exception {
     thrown.expect(NumberFormatException.class);
+    thrown.reportMissingExceptionWithMessage("Expected NumberFormatException on erroneous hex char");
     SqoopOptions.toChar("\\0x9K5");
   }
 
@@ -242,6 +248,7 @@ public class TestSqoopOptions {
     };
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on invalid --num-mappers argument");
     parse(args);
   }
 
@@ -253,6 +260,7 @@ public class TestSqoopOptions {
     };
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on invalid -m argument");
     parse(args);
   }
 
@@ -696,6 +704,8 @@ public class TestSqoopOptions {
     };
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on incompatibility of " +
+        "--delete-target-dir and --append");
     validateImportOptions(extraArgs);
   }
 
@@ -708,6 +718,8 @@ public class TestSqoopOptions {
     };
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException on incompatibility of " +
+        "--delete-target-dir and --incremental");
     validateImportOptions(extraArgs);
   }
 
@@ -732,6 +744,7 @@ public class TestSqoopOptions {
         longArgument(BaseSqoopTool.TARGET_DIR_ARG), "./test"};
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected InvalidOptionsException because of missing --hbase-table");
     validateImportOptions(extraArgs);
   }
 
@@ -764,6 +777,8 @@ public class TestSqoopOptions {
     };
 
     thrown.expect(SqoopOptions.InvalidOptionsException.class);
+    thrown.reportMissingExceptionWithMessage("Expected Exception on incompatibility of " +
+        "--autoreset-to-one-mapper and --split-by");
     validateImportOptions(extraArgs);
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/com/cloudera/sqoop/TestTargetDir.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/TestTargetDir.java b/src/test/com/cloudera/sqoop/TestTargetDir.java
index ded5392..d7ebd34 100644
--- a/src/test/com/cloudera/sqoop/TestTargetDir.java
+++ b/src/test/com/cloudera/sqoop/TestTargetDir.java
@@ -93,6 +93,7 @@ public class TestTargetDir extends ImportJobTestCase {
     String[] argv = (String[]) args.toArray(new String[0]);
 
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException on several output options");
     runImport(argv);
   }
 
@@ -148,6 +149,7 @@ public class TestTargetDir extends ImportJobTestCase {
     String[] argv = (String[]) args.toArray(new String[0]);
 
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException on --target-dir if target dir already exists");
     runImport(argv);
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ac5ca7c0/src/test/org/apache/sqoop/TestExportUsingProcedure.java
----------------------------------------------------------------------
diff --git a/src/test/org/apache/sqoop/TestExportUsingProcedure.java b/src/test/org/apache/sqoop/TestExportUsingProcedure.java
index b4b46f2..519305c 100644
--- a/src/test/org/apache/sqoop/TestExportUsingProcedure.java
+++ b/src/test/org/apache/sqoop/TestExportUsingProcedure.java
@@ -211,6 +211,7 @@ public class TestExportUsingProcedure extends TestExport {
   @Test
   public void testMultiMapTextExportWithStaging() throws IOException, SQLException {
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException as staging tables are not compatible with --call");
     super.testMultiMapTextExportWithStaging();
   }
 
@@ -218,6 +219,7 @@ public class TestExportUsingProcedure extends TestExport {
   @Test
   public void testMultiTransactionWithStaging() throws IOException, SQLException {
     thrown.expect(IOException.class);
+    thrown.reportMissingExceptionWithMessage("Expected IOException as staging tables are not compatible with --call");
     super.testMultiTransactionWithStaging();
   }