aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2021-02-15 13:17:18 +0000
committerDominik Stadler <centic@apache.org>2021-02-15 13:17:18 +0000
commit7a8f21b98950f250a8c068b51860ee9a61ac0b75 (patch)
tree7add865f95531b6d995d2265a3ad80b08ac4a96e /src
parent92134f34b1806867912bdd122f04099db145a4f6 (diff)
downloadpoi-7a8f21b98950f250a8c068b51860ee9a61ac0b75.tar.gz
poi-7a8f21b98950f250a8c068b51860ee9a61ac0b75.zip
Do not require NullPointerException to have a null-message on JDK < 16
It seems depending on the exact JDK some Exceptions have failure messages populated git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886527 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/integrationtest/org/apache/poi/stress/TestAllFiles.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
index 52ca60412e..8fbfd43c2f 100644
--- a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
+++ b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
@@ -20,7 +20,6 @@ package org.apache.poi.stress;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@@ -71,9 +70,7 @@ import org.opentest4j.AssertionFailedError;
// also need to set JVM parameter: -Djunit.jupiter.execution.parallel.enabled=true
@Execution(ExecutionMode.CONCURRENT)
public class TestAllFiles {
- private static final File ROOT_DIR = new File("test-data");
- private static final int jreVersion =
- Integer.parseInt(System.getProperty("java.version").replaceAll("^(?:1\\.)?(\\d+).*", "$1"));
+ public static final File ROOT_DIR = new File("test-data");
public static final String[] SCAN_EXCLUDES = {
"**/.svn/**",
@@ -124,7 +121,6 @@ public class TestAllFiles {
verify(file, exec, exClass, exMessage, password);
}
-
public static Stream<Arguments> handleFiles() throws IOException {
return allfiles("handle");
}
@@ -174,8 +170,6 @@ public class TestAllFiles {
Exception e = assertThrows((Class<? extends Exception>)exClass, exec);
String actMsg = pathReplace(e.getMessage());
if (NullPointerException.class.isAssignableFrom(exClass)) {
- // with Java 16+ NullPointerExceptions may contain a message ... but apparently not always ?!
- assertTrue(jreVersion >= 16 || actMsg == null, errPrefix);
if (actMsg != null) {
assertTrue(actMsg.contains(exMessage), errPrefix + "Message: "+actMsg+" - didn't contain: "+exMessage);
}