Author: kiwiwings
Date: Sun Jan 24 22:25:08 2021
New Revision: 1885888
URL: http://svn.apache.org/viewvc?rev=1885888&view=rev
Log:
try to fix windows integration tests
Modified:
poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
Modified:
poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java?rev=1885888&r1=1885887&r2=1885888&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
(original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
Sun Jan 24 22:25:08 2021
@@ -155,13 +155,10 @@ public abstract class SlideShowHandler e
// 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();
Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java?rev=1885888&r1=1885887&r2=1885888&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
(original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/TestAllFiles.java Sun
Jan 24 22:25:08 2021
@@ -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('\\', '/');
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]