diff options
author | Dominik Stadler <centic@apache.org> | 2022-11-13 19:22:13 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2022-11-13 19:22:13 +0000 |
commit | 56d47448cefd3b5dc5fb1b0562b3df046ce7ec02 (patch) | |
tree | cc09211dd8a7e0199cabd45e597ff5f356f2e0a0 /poi | |
parent | a0abaf205a613276d4846173237dfef9246ea361 (diff) | |
download | poi-56d47448cefd3b5dc5fb1b0562b3df046ce7ec02.tar.gz poi-56d47448cefd3b5dc5fb1b0562b3df046ce7ec02.zip |
Adjust tests, comments, JavaDoc, IDE suggestions
Add more output for a flaky test which sometimes fails on very slow hardware
Shutdown in tests gracefully
Otherwise an NPE may "hide" a test-failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1905273 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
3 files changed, 12 insertions, 4 deletions
diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java index fd94e0be19..97ec3f25dc 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java @@ -53,8 +53,12 @@ final class TestRVA { @AfterAll public static void closeResource() throws Exception { - workbook.close(); - poifs.close(); + if (workbook != null) { + workbook.close(); + } + if (poifs != null) { + poifs.close(); + } } public static Stream<Arguments> data() throws Exception { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java index d56c3d6134..081635d85a 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestMatrixFormulasFromBinarySpreadsheet.java @@ -101,7 +101,9 @@ final class TestMatrixFormulasFromBinarySpreadsheet { @AfterAll public static void closeResource() throws Exception { LocaleUtil.setUserLocale(userLocale); - workbook.close(); + if (workbook != null) { + workbook.close(); + } } /* generating parameter instances */ diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java index 98e10c0edc..fa5052458b 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java @@ -100,7 +100,9 @@ public final class TestFormulasFromSpreadsheet { @AfterAll public static void closeResource() throws Exception { LocaleUtil.setUserLocale(userLocale); - workbook.close(); + if (workbook != null) { + workbook.close(); + } } public static Stream<Arguments> data() { |