From 56717351c1a6820656e05704231e09f5efadcb08 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 2 Apr 2018 15:59:21 +0000 Subject: [PATCH] [bug-62216] add test case git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828174 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xssf/streaming/TestSXSSFCell.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java index 29ef231173..31617253df 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java @@ -28,6 +28,7 @@ import javax.xml.namespace.QName; import org.apache.poi.ss.usermodel.BaseTestXCell; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.FormulaError; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.SXSSFITestDataProvider; import org.apache.poi.xssf.usermodel.XSSFCell; @@ -61,7 +62,7 @@ public class TestSXSSFCell extends BaseTestXCell { "\nPOI", "\n\nPOI \n", }; - for(String str : samplesWithSpaces){ + for (String str : samplesWithSpaces) { Workbook swb = _testDataProvider.createWorkbook(); Cell sCell = swb.createSheet().createRow(0).createCell(0); sCell.setCellValue(str); @@ -82,4 +83,16 @@ public class TestSXSSFCell extends BaseTestXCell { swb.close(); } } + + @Test + public void test62216() throws IOException { + try (SXSSFWorkbook wb = new SXSSFWorkbook()) { + Cell instance = wb.createSheet().createRow(0).createCell(0); + String formula = "2"; + instance.setCellFormula(formula); + instance.setCellErrorValue(FormulaError.NAME.getCode()); + + assertEquals(formula, instance.getCellFormula()); + } + } } -- 2.39.5