mirror of https://github.com/apache/poi.git
try to fix windows integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ed836507e5
commit
6038381e3a
|
@ -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();
|
||||
|
|
|
@ -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('\\', '/');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue