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
diff --git a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
index 2497eb4..72f99c3 100644
--- a/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
+++ b/src/integrationtest/org/apache/poi/stress/AbstractFileHandler.java
@@ -88,10 +88,12 @@
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 @@
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");