Преглед на файлове

try to fix windows integration tests

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885888 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_1_0
Andreas Beeker преди 3 години
родител
ревизия
6038381e3a
променени са 2 файла, в които са добавени 12 реда и са изтрити 9 реда
  1. 4
    7
      src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
  2. 8
    2
      src/integrationtest/org/apache/poi/stress/TestAllFiles.java

+ 4
- 7
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();

+ 8
- 2
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('\\', '/');
}
}

Loading…
Отказ
Запис