From 47c5e9b08dea1a632de9b00b73494ee9e0d60832 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 6 Jan 2021 09:10:21 +0000 Subject: [PATCH] Adjust assumption for one specific font-related exception on Windows Otherwise it triggers too much and hides actual regression bugs git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885187 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/stress/SlideShowHandler.java | 8 +++++--- .../org/apache/poi/ooxml/TestTriggerCoverage.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java b/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java index 2fd0965157..315b47eac6 100644 --- a/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java +++ b/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java @@ -155,11 +155,13 @@ 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.assumeTrue( + 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"); + "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; } graphics.dispose(); diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java index 280a134be4..3839a460ef 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java @@ -151,11 +151,13 @@ public class TestTriggerCoverage { // 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( + 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"); + "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; } graphics.dispose(); -- 2.39.5