]> source.dussan.org Git - poi.git/commitdiff
bug 57840: add disabled unit test with large number of structured reference formulas
authorJaven O'Neal <onealj@apache.org>
Sat, 11 Jun 2016 11:28:55 +0000 (11:28 +0000)
committerJaven O'Neal <onealj@apache.org>
Sat, 11 Jun 2016 11:28:55 +0000 (11:28 +0000)
patch and spreadsheet contributed by Mark Woolsey

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1747878 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
test-data/spreadsheet/StructuredRefs-lots-with-lookups.xlsx [new file with mode: 0644]

index a6d5bdb966ce13994034d036f908f51597ee75a7..b64ef25013f1fd7a27f445529f1699e4cdc316cf 100644 (file)
@@ -609,10 +609,20 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
     // bug 57721
     @Test
     public void structuredReferences() throws IOException {
-        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("evaluate_formula_with_structured_table_references.xlsx");
-        
-        XSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
+        verifyAllFormulasInWorkbookCanBeEvaluated("evaluate_formula_with_structured_table_references.xlsx");
+    }
+    
+    // bug 57840
+    @Ignore("Takes over a minute to evaluate all formulas in this large workbook. Run this test when profiling for formula evaluation speed.")
+    @Test
+    public void testLotsOfFormulasWithStructuredReferencesToCalculatedTableColumns() throws IOException {
+        verifyAllFormulasInWorkbookCanBeEvaluated("StructuredRefs-lots-with-lookups.xlsx");
+    }
 
+    // FIXME: use junit4 parameterization
+    private static void verifyAllFormulasInWorkbookCanBeEvaluated(String sampleWorkbook) throws IOException {
+        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook(sampleWorkbook);
+        XSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
         wb.close();
     }
 
diff --git a/test-data/spreadsheet/StructuredRefs-lots-with-lookups.xlsx b/test-data/spreadsheet/StructuredRefs-lots-with-lookups.xlsx
new file mode 100644 (file)
index 0000000..11845f8
Binary files /dev/null and b/test-data/spreadsheet/StructuredRefs-lots-with-lookups.xlsx differ