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 16:07:08 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1578

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
---
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(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/78/1578/1

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: newchange
Gerrit-Change-Id: Ie0239010579a495a42b68c1f3cf19e8b03f72eee
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message