From 5e110d72167461ee5842b56a347d8e159b88c22c Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 16 Jan 2021 09:55:42 +0000 Subject: [PATCH] integration tests: NullPointerExceptions contain now a description in Java 16+ git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885549 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/stress/TestAllFiles.java | 12 ++++++++++-- test-data/spreadsheet/stress.xls | Bin 37888 -> 38400 bytes 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java index 9bce94f0db..347559330f 100644 --- a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java @@ -88,7 +88,15 @@ import org.opentest4j.AssertionFailedError; @Execution(ExecutionMode.CONCURRENT) public class TestAllFiles { private static final File ROOT_DIR = new File("test-data"); - + private static final int jreVersion; + + static { + String version = System.getProperty("java.version"); + String major = version.startsWith("1.") + ? version.substring(2, 3) + : version.substring(0, version.indexOf(".")); + jreVersion = Integer.parseInt(major); + } public static final String[] SCAN_EXCLUDES = { "**/.svn/**", @@ -204,7 +212,7 @@ public class TestAllFiles { } else if (exClass != null) { Exception e = assertThrows((Class)exClass, exec); String actMsg = e.getMessage(); - if (exMessage == null) { + if ((NullPointerException.class.isAssignableFrom(exClass) && jreVersion < 16) || exMessage == null) { assertNull(actMsg); } else { assertNotNull(actMsg); diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 004069cffe2dc1d2186633ab7fdb02d443084794..065ad65564bf825eb53dd468be2f636755fd3888 100644 GIT binary patch delta 10242 zcmZWu30z!98K2z*l91yOAa5ZHVHX0+LLiU?2v;tSkTislKrSF;3kx9uw&e&pnl5Rp zJ)^CoR;@ACv$gf=T5o%JSFNp9TeaS|R*hP<+G^u`-}`3Xe!nKayfE`W=9_tQe9W7> z&pY>^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