diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-01-16 09:55:42 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-01-16 09:55:42 +0000 |
commit | 5e110d72167461ee5842b56a347d8e159b88c22c (patch) | |
tree | 949b5807be5589e84ca222da9d5ffd90e6404cc0 /src | |
parent | 8a388f61e8744a3231baddaabc14ec409032b5a6 (diff) | |
download | poi-5e110d72167461ee5842b56a347d8e159b88c22c.tar.gz poi-5e110d72167461ee5842b56a347d8e159b88c22c.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/TestAllFiles.java | 12 |
1 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<? extends Exception>)exClass, exec); String actMsg = e.getMessage(); - if (exMessage == null) { + if ((NullPointerException.class.isAssignableFrom(exClass) && jreVersion < 16) || exMessage == null) { assertNull(actMsg); } else { assertNotNull(actMsg); |