]> source.dussan.org Git - poi.git/commitdiff
added a unit test for not reproducible bug #49156
authorYegor Kozlov <yegor@apache.org>
Sat, 11 Dec 2010 13:09:12 +0000 (13:09 +0000)
committerYegor Kozlov <yegor@apache.org>
Sat, 11 Dec 2010 13:09:12 +0000 (13:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1044647 13f79535-47bb-0310-9956-ffa450edef68

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

index 40cb33fae31e741a1714dd5cac3689bca68f9459..3d9d69297e346b97e1c72b64356ac65d358d3dad 100644 (file)
@@ -588,4 +588,18 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
        assertEquals("A9", cc.getCTCalcChain().getCArray(2).getR());
 
     }
+
+    public void test49156() throws Exception {
+        Workbook wb = XSSFTestDataSamples.openSampleWorkbook("49156.xlsx");
+        FormulaEvaluator formulaEvaluator = wb.getCreationHelper().createFormulaEvaluator();
+
+        Sheet sheet = wb.getSheetAt(0);
+        for(Row row : sheet){
+            for(Cell cell : row){
+                if(cell.getCellType() == Cell.CELL_TYPE_FORMULA){
+                    formulaEvaluator.evaluateInCell(cell); // caused NPE on some cells
+                }
+            }
+        }
+    }
 }
diff --git a/test-data/spreadsheet/49156.xlsx b/test-data/spreadsheet/49156.xlsx
new file mode 100644 (file)
index 0000000..ca41dc6
Binary files /dev/null and b/test-data/spreadsheet/49156.xlsx differ