]> source.dussan.org Git - poi.git/commitdiff
Add a disabled unit test for bug #56420
authorNick Burch <nick@apache.org>
Thu, 3 Jul 2014 14:30:47 +0000 (14:30 +0000)
committerNick Burch <nick@apache.org>
Thu, 3 Jul 2014 14:30:47 +0000 (14:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1607661 13f79535-47bb-0310-9956-ffa450edef68

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

index 71f462361c2d5551c6891b5d2cdcae88cfa3743a..13e6629b7799078a138318c0f37edd131389f742 100644 (file)
@@ -1565,6 +1565,23 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         File xlsOutput = TempFile.createTempFile("testBug53798", ".xls");
         bug53798Work(wb, xlsOutput);
     }
+    
+    /**
+     * SUMIF was throwing a NPE on some formulas
+     */
+    @Test
+    @Ignore("This bug is still to be fixed")
+    public void testBug56420SumIfNPE() throws Exception {
+        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56420.xlsx");
+        
+        FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+
+        Sheet sheet = wb.getSheetAt(0);
+        Row r = sheet.getRow(2);
+        Cell c = r.getCell(2);
+        assertEquals("SUMIF($A$1:$A$4,A3,$B$1:$B$4)", c.getCellFormula());
+        evaluator.evaluateInCell(c);
+    }
 
     private void bug53798Work(Workbook wb, File xlsOutput) throws IOException {
         Sheet testSheet = wb.getSheetAt(0);
diff --git a/test-data/spreadsheet/56420.xlsx b/test-data/spreadsheet/56420.xlsx
new file mode 100644 (file)
index 0000000..bd1ceff
Binary files /dev/null and b/test-data/spreadsheet/56420.xlsx differ