Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7F77C200CF7 for ; Tue, 19 Sep 2017 21:19:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7E05D1609DD; Tue, 19 Sep 2017 19:19:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C13391609BF for ; Tue, 19 Sep 2017 21:19:36 +0200 (CEST) Received: (qmail 62234 invoked by uid 500); 19 Sep 2017 19:19:36 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 62224 invoked by uid 99); 19 Sep 2017 19:19:35 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2017 19:19:35 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 722A33A01AB for ; Tue, 19 Sep 2017 19:19:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1808932 - /poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java Date: Tue, 19 Sep 2017 19:19:30 -0000 To: commits@poi.apache.org From: centic@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170919191934.722A33A01AB@svn01-us-west.apache.org> archived-at: Tue, 19 Sep 2017 19:19:37 -0000 Author: centic Date: Tue Sep 19 19:19:30 2017 New Revision: 1808932 URL: http://svn.apache.org/viewvc?rev=1808932&view=rev Log: Add test to verify that bug 61532 is fixed as far as I see via the changes for bug 61148. Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java?rev=1808932&r1=1808931&r2=1808932&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java (original) +++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java Tue Sep 19 19:19:30 2017 @@ -17,16 +17,13 @@ package org.apache.poi.ss.usermodel; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; - import java.io.IOException; import org.apache.poi.ss.ITestDataProvider; import org.junit.Test; +import static org.junit.Assert.*; + /** * Common superclass for testing implementation of {@link FormulaEvaluator} */ @@ -600,4 +597,31 @@ public abstract class BaseTestFormulaEva private Cell getCell(Sheet sheet, int rowNo, int column) { return sheet.getRow(rowNo).getCell(column); } + + @Test + public void testBug61532() throws IOException { + try (Workbook wb = _testDataProvider.createWorkbook()) { + final Cell cell = wb.createSheet().createRow(0).createCell(0); + cell.setCellFormula("1+2"); + + assertEquals(0, (int)cell.getNumericCellValue()); + assertEquals("1+2", cell.toString()); + + FormulaEvaluator eval = wb.getCreationHelper().createFormulaEvaluator(); + + CellValue value = eval.evaluate(cell); + + assertEquals(CellType.NUMERIC, value.getCellType()); + assertEquals(3.0, value.getNumberValue(), 0.01); + assertEquals(CellType.FORMULA, cell.getCellType()); + assertEquals("1+2", cell.getCellFormula()); + assertEquals("1+2", cell.toString()); + + assertNotNull(eval.evaluateInCell(cell)); + + assertEquals("3.0", cell.toString()); + assertEquals(CellType.NUMERIC, cell.getCellType()); + assertEquals(3.0, cell.getNumericCellValue(), 0.01); + } + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org