aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-03-08 23:14:11 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-03-08 23:14:11 +0000
commitcee9eb7e2b487c4b451bd167e07e6309835a943b (patch)
treefbc9b10c2c9b7a15886207dbc4fbbb1eff695f2f /src
parentafbef57d3591b4beca5e17907d51e23e2aacc050 (diff)
downloadpoi-cee9eb7e2b487c4b451bd167e07e6309835a943b.tar.gz
poi-cee9eb7e2b487c4b451bd167e07e6309835a943b.zip
try to fix windows path issues in exception messages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887346 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
index 2497eb43cf..72f99c3f05 100644
--- a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
+++ b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
@@ -88,10 +88,12 @@ public abstract class AbstractFileHandler implements FileHandler {
POITextExtractor extractor = null;
String fileAndParentName = file.getParentFile().getName() + "/" + file.getName();
try {
+ // fix windows absolute paths for exception message tracking
+ String relPath = file.getPath().replace(".*test-data", "test-data").replace('\\', '/');
extractor = ExtractorFactory.createExtractor(file);
- assertNotNull(extractor, "Should get a POITextExtractor but had none for file " + file);
+ assertNotNull(extractor, "Should get a POITextExtractor but had none for file " + relPath);
- assertNotNull(extractor.getText(), "Should get some text but had none for file " + file);
+ assertNotNull(extractor.getText(), "Should get some text but had none for file " + relPath);
// also try metadata
@SuppressWarnings("resource")
@@ -99,7 +101,7 @@ public abstract class AbstractFileHandler implements FileHandler {
assertNotNull(metadataExtractor.getText());
assertFalse(EXPECTED_EXTRACTOR_FAILURES.contains(fileAndParentName),
- "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!");
+ "Expected Extraction to fail for file " + relPath + " and handler " + this + ", but did not fail!");
assertEquals(length, file.length(), "File should not be modified by extractor");
assertEquals(modified, file.lastModified(), "File should not be modified by extractor");