From 543d6ad54b498081537d5c1ad5201fcf4606c784 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 9 Aug 2023 05:44:01 +0000 Subject: Do not disable all files for poi-integration in build.gradle It seems doing it this way can kick in even when using JDK 11+ due to the Gradle toolchain. Let's rather do a more specific exclusion in code to only exclude files which actually cause JDK 8 to hang. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911562 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/poi/stress/TestAllFiles.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'poi-integration/src/test') diff --git a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java index a9f3b37aee..b636459146 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java @@ -36,6 +36,7 @@ import java.util.stream.Stream; import org.apache.poi.POIDataSamples; import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; import org.apache.tools.ant.DirectoryScanner; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.function.Executable; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -200,6 +201,13 @@ public class TestAllFiles { String threadName = Thread.currentThread().getName(); try { Thread.currentThread().setName("Handle - " + file + " - " + handler); + + // Some of the tests hang in JDK 8 due to Graphics-Rendering issues in JDK itself, + // therefore we do not run some tests here + Assumptions.assumeFalse(isJava8() && ( + file.endsWith("23884_defense_FINAL_OOimport_edit.ppt") + ), "Some files hang in JDK graphics rendering on Java 8 due to a JDK bug"); + System.out.println("Running handleFiles on "+file); FileHandler fileHandler = handler.getHandler(); assertNotNull(fileHandler, "Did not find a handler for file " + file); @@ -301,4 +309,8 @@ public class TestAllFiles { return msg; } + + private static boolean isJava8() { + return System.getProperty("java.version").startsWith("1.8"); + } } -- cgit v1.2.3