]> source.dussan.org Git - poi.git/commitdiff
Update JUnit5Progress to print out information on internal failures
authorDominik Stadler <centic@apache.org>
Sun, 13 Nov 2022 19:22:28 +0000 (19:22 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 13 Nov 2022 19:22:28 +0000 (19:22 +0000)
Otherwise sometimes tests are failing, but we don't see why

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1905278 13f79535-47bb-0310-9956-ffa450edef68

poi-excelant/src/poi-ant-contrib/java/Junit5Progress.java

index 8e87ef064f7548cb1f75ab29971bd617aec2a0e0..a4170b6154af9be5913acca921c4d85725ff8913 100644 (file)
@@ -76,17 +76,17 @@ public class Junit5Progress implements TestExecutionListener {
             String summary = String.format("Tests run: %d, Failures: %d, Aborted: %d, Skipped: %d, Time elapsed: %f sec", totalTestsInClass,
                 this.numFailedInTestSet.get(), this.numAbortedInTestSet.get(), this.numSkippedInTestSet.get(), numSeconds);
             println(summary);
-        } else if (testIdentifier.isTest()) {
+        } else {
             switch (testExecutionResult.getStatus()) {
                 case SUCCESSFUL:
                     this.numSucceededInTestSet.incrementAndGet();
                     break;
                 case ABORTED:
-                    println("   Aborted: " + testIdentifier.getDisplayName());
+                    println("   Aborted: " + testIdentifier.getDisplayName() + ": " + testExecutionResult.getThrowable().orElse(null));
                     this.numAbortedInTestSet.incrementAndGet();
                     break;
                 case FAILED:
-                    println("   Failed: " + testIdentifier.getDisplayName());
+                    println("   Failed: " + testIdentifier.getDisplayName() + ": " + testExecutionResult.getThrowable().orElse(null));
                     this.numFailedInTestSet.incrementAndGet();
                     break;
             }