Преглед на файлове

Allow all IndexOutOfBoundsException to have either empty message or some message

Newer JDKs add a more useful exception message, so we need to be a bit more
lenient for these in integration tests

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914708 13f79535-47bb-0310-9956-ffa450edef68
pull/564/head
Dominik Stadler преди 5 месеца
родител
ревизия
53cfc2cc96
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3
    2
      poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java
  2. Двоични данни
      test-data/spreadsheet/stress.xls

+ 3
- 2
poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java Целия файл

@@ -287,9 +287,10 @@ public class TestAllFiles {
errPrefix + " for " + exClass + " expected message '" + exMessage + "' but had '" + actMsg + "': " + e);

if (actMsg != null &&
// sometimes ArrayIndexOutOfBoundsException has null-message?!?
// in newer JDK versions IndexOutOfBoundsException switch from empty message
// to more useful content
// so skip the check for this type of exception if expected message is null
(exMessage != null || !ArrayIndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
(exMessage != null || !IndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
assertNotNull(exMessage,
errPrefix + "Expected message was null, but actMsg wasn't: Message: " + actMsg + ": " + e);
assertTrue(actMsg.contains(exMessage),

Двоични данни
test-data/spreadsheet/stress.xls Целия файл


Loading…
Отказ
Запис