You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2026/03/08 18:41:54 UTC

(poi) branch trunk updated: work around poi-scratchpad issue

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9cd4103387 work around poi-scratchpad issue
9cd4103387 is described below

commit 9cd41033870ebe180c0451c858e78446c3cabcc2
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sun Mar 8 19:41:47 2026 +0100

    work around poi-scratchpad issue
---
 .../test/java/org/apache/poi/stress/StressMap.java | 58 ++++++++++++----------
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/poi-integration/src/test/java/org/apache/poi/stress/StressMap.java b/poi-integration/src/test/java/org/apache/poi/stress/StressMap.java
index 73334fed2a..568d8c5e1d 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/StressMap.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/StressMap.java
@@ -33,6 +33,7 @@ import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVRecord;
 import org.apache.commons.io.input.BOMInputStream;
+import org.opentest4j.AssertionFailedError;
 
 public class StressMap {
     private final MultiValuedMap<String, ExcInfo> exMap = new ArrayListValuedHashMap<>();
@@ -113,32 +114,37 @@ public class StressMap {
             records.forEach(record -> {
                 final String file = record.get("File");
                 if (file != null && !file.isBlank()) {
-                    ExcInfo info = new ExcInfo();
-                    info.setFile(file);
-                    String tests = record.get("Tests");
-                    if (tests != null && !tests.isBlank()) {
-                        info.setTests(tests);
-                    }
-                    String handler = record.get("Handler");
-                    if (handler != null && !handler.isBlank()) {
-                        info.setHandler(handler);
-                    }
-                    String password = record.get("Password");
-                    if (password != null && !password.isBlank()) {
-                        info.setPassword(password);
-                    }
-                    String exClass = record.get("Exception Class");
-                    if (exClass != null && !exClass.isBlank()) {
-                        info.setExClazz(exClass);
-                    }
-                    String exMessage = record.get("Exception Message");
-                    if (exMessage != null && !exMessage.isBlank()) {
-                        info.setExMessage(exMessage);
-                    }
-                    final boolean ignore =
-                            SCRATCH_IGNORE && SCRATCH_HANDLER.matcher(info.getHandler()).find();
-                    if (!ignore) {
-                        exMap.put(file, info);
+                    try {
+                        ExcInfo info = new ExcInfo();
+                        info.setFile(file);
+                        String tests = record.get("Tests");
+                        if (tests != null && !tests.isBlank()) {
+                            info.setTests(tests);
+                        }
+                        String handler = record.get("Handler");
+                        if (handler != null && !handler.isBlank()) {
+                            info.setHandler(handler);
+                        }
+                        String password = record.get("Password");
+                        if (password != null && !password.isBlank()) {
+                            info.setPassword(password);
+                        }
+                        String exClass = record.get("Exception Class");
+                        if (exClass != null && !exClass.isBlank()) {
+                            info.setExClazz(exClass);
+                        }
+                        String exMessage = record.get("Exception Message");
+                        if (exMessage != null && !exMessage.isBlank()) {
+                            info.setExMessage(exMessage);
+                        }
+                        final boolean ignore =
+                                SCRATCH_IGNORE && SCRATCH_HANDLER.matcher(info.getHandler()).find();
+                        if (!ignore) {
+                            exMap.put(file, info);
+                        }
+                    } catch (AssertionFailedError assertionFailedError) {
+                        // can happen when testing with poi-scratchpad
+                        // see ExcInfo#setExClazz
                     }
                 }
             });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org