diff options
author | Dominik Stadler <centic@apache.org> | 2019-02-23 07:51:57 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2019-02-23 07:51:57 +0000 |
commit | 8c6e95f597620e5c117fa39cbd564d98f28a382d (patch) | |
tree | e3c732ebeb3239c4600bdac7b6d9b4c6c7ddd1b0 /src/integrationtest/org/apache/poi | |
parent | 34d6410bc1e3e2d51256de23e434ce2f8c507e18 (diff) | |
download | poi-8c6e95f597620e5c117fa39cbd564d98f28a382d.tar.gz poi-8c6e95f597620e5c117fa39cbd564d98f28a382d.zip |
Add some more testing for bug 63151: NullPointerException in HSSFOptimiser.optimiseFonts(), also execute it as part of large regression tests in the future
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1854190 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org/apache/poi')
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java index 119175b82e..603231022e 100644 --- a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java @@ -64,6 +64,8 @@ public class HSSFFileHandler extends SpreadsheetHandler { } } } + + HSSFOptimiser.optimiseFonts(wb); } private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<>(); @@ -85,6 +87,7 @@ public class HSSFFileHandler extends SpreadsheetHandler { public void handleAdditional(File file) throws Exception { // redirect stdout as the examples often write lots of text PrintStream oldOut = System.out; + String fileWithParent = file.getParentFile().getName() + "/" + file.getName(); try { System.setOut(new PrintStream(new OutputStream() { @Override @@ -95,11 +98,11 @@ public class HSSFFileHandler extends SpreadsheetHandler { BiffViewer.main(new String[]{file.getAbsolutePath()}); assertFalse("Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!", - EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())); + EXPECTED_ADDITIONAL_FAILURES.contains(fileWithParent)); } catch (OldExcelFormatException e) { // old excel formats are not supported here } catch (RuntimeException e) { - if(!EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())) { + if(!EXPECTED_ADDITIONAL_FAILURES.contains(fileWithParent)) { throw e; } } finally { |