Browse Source

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
tags/REL_5_1_0
Andreas Beeker 3 years ago
parent
commit
5e110d7216

+ 10
- 2
src/integrationtest/org/apache/poi/stress/TestAllFiles.java View File

@@ -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);

BIN
test-data/spreadsheet/stress.xls View File


Loading…
Cancel
Save