asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Eliminate Unnecessary printStackTrace() Calls
Date Tue, 14 Mar 2017 18:09:55 GMT
Michael Blow has submitted this change and it was merged.

Change subject: Eliminate Unnecessary printStackTrace() Calls
......................................................................


Eliminate Unnecessary printStackTrace() Calls

Stacktraces flood test logs for expected exceptions.  This change
suppresses stacktraces in these instances.

Change-Id: Ie0239010579a495a42b68c1f3cf19e8b03f72eee
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1578
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
---
M asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
M asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  abdullah alamoudi: Looks good to me, approved
  Jenkins: Verified; No violations found



diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
index 9a3de14..5bcad8c 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
@@ -900,7 +900,7 @@
                 } catch (Exception e) {
                     // An exception is expected.
                     failed = true;
-                    e.printStackTrace();
+                    System.err.println("testFile " + testFile.toString() + " raised an exception:
" + e);
                 }
                 if (!failed) {
                     throw new Exception("Test \"" + testFile + "\" FAILED!\n  An exception"
+ "is expected.");
@@ -928,7 +928,7 @@
                 } catch (Exception e) {
                     // expected error happens
                     failed = true;
-                    e.printStackTrace();
+                    System.err.println("testFile " + testFile.toString() + " raised an exception:
" + e);
                 }
                 if (!failed) {
                     throw new Exception("Test \"" + testFile + "\" FAILED!\n  An exception
is expected.");
@@ -1219,7 +1219,7 @@
                         System.err.println("...Unexpected!");
                         Exception e = new Exception(
                                 "Test \"" + cUnit.getName() + "\" FAILED!\nExpected error
was not thrown...");
-                        e.printStackTrace();
+                        System.err.println(e);
                         throw e;
                     } else if (numOfFiles == testFileCtxs.size()) {
                         LOGGER.info("[TEST]: " + testCaseCtx.getTestCase().getFilePath()
+ "/" + cUnit.getName()
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
index 0789fa0..da8f810 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
@@ -91,9 +91,9 @@
                             "[TEST]: " + testCaseCtx.getTestCase().getFilePath() + "/" +
cUnit.getName() + " PASSED ");
                     queryCount++;
                 } catch (Exception e) {
-                    System.err.println("testFile " + testFile.toString() + " raised an exception:");
-                    e.printStackTrace();
+                    System.err.println("testFile " + testFile.toString() + " raised an exception:
" + e);
                     if (cUnit.getExpectedError().isEmpty()) {
+                        e.printStackTrace();
                         System.err.println("...Unexpected!");
                         if (failedGroup != null) {
                             failedGroup.getTestCase().add(testCaseCtx.getTestCase());

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1578
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0239010579a495a42b68c1f3cf19e8b03f72eee
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message