aboutsummaryrefslogtreecommitdiffstats
path: root/poi-integration/src/test/java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-08-06 17:13:46 +0000
committerDominik Stadler <centic@apache.org>2023-08-06 17:13:46 +0000
commit6f054ddce1f84edc5f2f85f89904c03df3c1727a (patch)
treefbb9414dfd53746478f26eb6595daeffe376c4c3 /poi-integration/src/test/java
parent1e8e95c3a659e88c3303f6247298c3b865229122 (diff)
downloadpoi-6f054ddce1f84edc5f2f85f89904c03df3c1727a.tar.gz
poi-6f054ddce1f84edc5f2f85f89904c03df3c1727a.zip
Fix expected exception text and print out which FileHandler failed in integration-tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911495 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration/src/test/java')
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java
index fcba54a263..a48d0cbc29 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java
@@ -184,7 +184,7 @@ public class TestAllFiles {
FileHandler fileHandler = handler.getHandler();
assertNotNull(fileHandler, "Did not find a handler for file " + file);
Executable exec = () -> fileHandler.handleExtracting(new File(ROOT_DIR, file));
- verify(file, exec, exClass, exMessage, password);
+ verify(file, exec, exClass, exMessage, password, fileHandler);
} finally {
Thread.currentThread().setName(threadName);
}
@@ -205,7 +205,7 @@ public class TestAllFiles {
assertNotNull(fileHandler, "Did not find a handler for file " + file);
try (InputStream stream = new BufferedInputStream(new FileInputStream(new File(ROOT_DIR, file)), 64 * 1024)) {
Executable exec = () -> fileHandler.handleFile(stream, file);
- verify(file, exec, exClass, exMessage, password);
+ verify(file, exec, exClass, exMessage, password, fileHandler);
}
} finally {
Thread.currentThread().setName(threadName);
@@ -226,15 +226,16 @@ public class TestAllFiles {
FileHandler fileHandler = handler.getHandler();
assertNotNull(fileHandler, "Did not find a handler for file " + file);
Executable exec = () -> fileHandler.handleAdditional(new File(ROOT_DIR, file));
- verify(file, exec, exClass, exMessage, password);
+ verify(file, exec, exClass, exMessage, password, fileHandler);
} finally {
Thread.currentThread().setName(threadName);
}
}
@SuppressWarnings("unchecked")
- private static void verify(String file, Executable exec, Class<? extends Throwable> exClass, String exMessage, String password) {
- final String errPrefix = file + " - failed. ";
+ private static void verify(String file, Executable exec, Class<? extends Throwable> exClass, String exMessage, String password,
+ FileHandler fileHandler) {
+ final String errPrefix = file + " - failed for handler " + fileHandler.getClass().getSimpleName() + ": ";
// this also removes the password for non encrypted files
Biff8EncryptionKey.setCurrentUserPassword(password);
if (exClass != null && AssertionFailedError.class.isAssignableFrom(exClass)) {