]> source.dussan.org Git - poi.git/commitdiff
Tried to evaluate all formulas in worksheets as part of the integration tests, but...
authorDominik Stadler <centic@apache.org>
Wed, 6 Apr 2016 19:50:14 +0000 (19:50 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 6 Apr 2016 19:50:14 +0000 (19:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738034 13f79535-47bb-0310-9956-ffa450edef68

src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java

index adf8f16e736bb82934da7a8bf24e162c5292573a..123bfa7450711e6d4d9c4246a9df227b63c72c12 100644 (file)
@@ -44,7 +44,7 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
                // write once more
                ByteArrayOutputStream out = writeToArray(wb);
 
-               // read in the writen file
+               // read in the written file
                Workbook read;
                try {
                        read = WorkbookFactory.create(new ByteArrayInputStream(out.toByteArray()));
@@ -93,6 +93,21 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
        }
        
        private void modifyContent(Workbook wb) {
+               /* a number of file fail because of various things: udf, unimplemented functions, ...
+               we would need quite a list of excludes and the large regression tests would probably
+               take a lot longer to run...
+               try {
+                       // try to re-compute all formulas to find cases where parsing fails
+                       wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
+               } catch (RuntimeException e) {
+                       // only allow a specific exception which indicates that an external
+                       // reference was not found
+                       if(!e.getMessage().contains("Could not resolve external workbook name")) {
+                               throw e;
+                       }
+
+               }*/
+
            for (int i=wb.getNumberOfSheets()-1; i>=0; i--) {
                try {
                    wb.cloneSheet(i);