>From Michael Blow <[email protected]>:

Michael Blow has submitted this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20023 )

Change subject: [NO ISSUE][*DB][TEST] Minor test framework fixes
......................................................................

[NO ISSUE][*DB][TEST] Minor test framework fixes

Ext-ref: MB-65861
Change-Id: I5cad75b8263f8461a73405531beeb056254ae47e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20023
Integration-Tests: Jenkins <[email protected]>
Reviewed-by: Michael Blow <[email protected]>
Tested-by: Michael Blow <[email protected]>
---
M 
asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java
1 file changed, 22 insertions(+), 2 deletions(-)

Approvals:
  Michael Blow: Looks good to me, approved; Verified
  Jenkins: Verified




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 f9d0efb..8d943bf 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
@@ -2254,16 +2254,22 @@
                         }
                         fail(true, testCaseCtx, cUnit, testFileCtxs, pb, 
testFile, e);
                     } else {
-                        LOGGER.info("testFile {} raised an (expected) 
exception", testFile, e.toString());
+                        LOGGER.info("testFile {} raised an (expected) 
exception: {}", testFile, e.toString());
                     }
                 }
                 if (numOfFiles == testFileCtxs.size()) {
-                    if (testCaseCtx.numOfErrors < 
cUnit.getExpectedError().size()) {
+                    int numExpectedErrors = cUnit.getExpectedError().size();
+                    if (testCaseCtx.numOfErrors < numExpectedErrors) {
                         LOGGER.error("Test {} failed to raise (an) expected 
exception(s)", cUnit.getName());
                         throw new Exception(
                                 "Test \"" + cUnit.getName() + "\" FAILED; 
expected exception was not thrown...");
                     }
                     ensureWarnings(testCaseCtx.expectedWarnings, cUnit);
+                    if (testCaseCtx.numOfErrors > numExpectedErrors) {
+                        LOGGER.error("Test {} raised more exceptions than 
expected", cUnit.getName());
+                        throw new Exception(
+                                "Test \"" + cUnit.getName() + "\" FAILED; too 
many exceptions were thrown...");
+                    }
                     LOGGER.info(
                             "[TEST]: " + 
testCaseCtx.getTestCase().getFilePath() + "/" + cUnit.getName() + " PASSED ");
                     if (passedGroup != null) {

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20023
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I5cad75b8263f8461a73405531beeb056254ae47e
Gerrit-Change-Number: 20023
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Blow <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-MessageType: merged

Reply via email to