diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-01-24 22:25:08 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-01-24 22:25:08 +0000 |
commit | 6038381e3aa07c1c0cdf849759509545a838519a (patch) | |
tree | 32a8bed1acb7992708da50b655d874b9ad78d5cc /src | |
parent | ed836507e50e5f12a0204652863f7002fa243b52 (diff) | |
download | poi-6038381e3aa07c1c0cdf849759509545a838519a.tar.gz poi-6038381e3aa07c1c0cdf849759509545a838519a.zip |
try to fix windows integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885888 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/SlideShowHandler.java | 11 | ||||
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/TestAllFiles.java | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java b/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java index 315b47eac6..9a1defbf21 100644 --- a/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java +++ b/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java @@ -155,13 +155,10 @@ public abstract class SlideShowHandler extends POIFSFileHandler { // We saw exceptions with JDK 8 on Windows in the Jenkins CI which // seem to only be triggered by some font (maybe Calibri?!) // We cannot avoid this, so let's try to not make the tests fail in this case - Assumptions.assumeFalse( - e.getMessage().equals("-1") && - ExceptionUtils.readStackTrace(e).contains("ExtendedTextSourceLabel.getJustificationInfos"), - "JDK sometimes fails at this point on some fonts on Windows machines, but we " + - "should not fail the build because of this: " + ExceptionUtils.readStackTrace(e)); - - throw e; + if (!"-1".equals(e.getMessage()) || + !ExceptionUtils.readStackTrace(e).contains("ExtendedTextSourceLabel.getJustificationInfos")) { + throw e; + } } graphics.dispose(); diff --git a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java index 81c31d3a21..52ca60412e 100644 --- a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java @@ -165,13 +165,14 @@ public class TestAllFiles { exec.execute(); fail(errPrefix + "Expected failed assertion"); } catch (AssertionFailedError e) { - assertEquals(exMessage, e.getMessage(), errPrefix); + String actMsg = pathReplace(e.getMessage()); + assertEquals(exMessage, actMsg, errPrefix); } catch (Throwable e) { fail(errPrefix + "Unexpected exception", e); } } else if (exClass != null) { Exception e = assertThrows((Class<? extends Exception>)exClass, exec); - String actMsg = e.getMessage(); + String actMsg = pathReplace(e.getMessage()); if (NullPointerException.class.isAssignableFrom(exClass)) { // with Java 16+ NullPointerExceptions may contain a message ... but apparently not always ?! assertTrue(jreVersion >= 16 || actMsg == null, errPrefix); @@ -186,4 +187,9 @@ public class TestAllFiles { assertDoesNotThrow(exec, errPrefix); } } + + private static String pathReplace(String msg) { + // Windows path replacement + return msg == null ? null : msg.replace('\\', '/'); + } } |