aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2021-01-03 17:02:18 +0000
committerDominik Stadler <centic@apache.org>2021-01-03 17:02:18 +0000
commit83383cd0b7ad81d704f68045683d46f9669277bc (patch)
tree2080e26f768c227db2a9d0930ea19a8d9ed3945f /src/ooxml/testcases/org/apache/poi
parentfcf123fc5bc67fc87a26a92ce4e75e65dc330d88 (diff)
downloadpoi-83383cd0b7ad81d704f68045683d46f9669277bc.tar.gz
poi-83383cd0b7ad81d704f68045683d46f9669277bc.zip
Ignore Font-issue with JDK 8 on Windows in another test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885069 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi')
-rw-r--r--src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java
index f01d3dcc90..d7c9a8ae6b 100644
--- a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java
+++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java
@@ -33,6 +33,7 @@ import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.platform.commons.util.ExceptionUtils;
import java.awt.Dimension;
import java.awt.Graphics2D;
@@ -145,8 +146,19 @@ public class TestTriggerCoverage {
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
graphics.setRenderingHint(Drawable.BUFFERED_IMAGE, new WeakReference<>(img));
- // draw stuff
- s.draw(graphics);
+ try {
+ // draw stuff
+ s.draw(graphics);
+ } catch (ArrayIndexOutOfBoundsException 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.assumeTrue(
+ 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");
+ }
graphics.dispose();
img.flush();