poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1717178 - /poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
Date Mon, 30 Nov 2015 05:21:01 GMT
Author: onealj
Date: Mon Nov 30 05:21:01 2015
New Revision: 1717178

URL: http://svn.apache.org/viewvc?rev=1717178&view=rev
Log:
testBool/testErr: check values before writeOutAndReadBack

Modified:
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java?rev=1717178&r1=1717177&r2=1717178&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java Mon Nov 30 05:21:01
2015
@@ -156,13 +156,16 @@ public abstract class BaseTestCell {
         assertEquals(0, c.getRowIndex());
         assertEquals(1, c.getColumnIndex());
         c.setCellValue(true);
+        assertEquals("B1 value", true, c.getBooleanCellValue());
 
         // C1
         c=r.createCell(2);
         assertEquals(0, c.getRowIndex());
         assertEquals(2, c.getColumnIndex());
         c.setCellValue(false);
+        assertEquals("C1 value", false, c.getBooleanCellValue());
 
+        // Make sure values are saved and re-read correctly.
         Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1);
         wb1.close();
         
@@ -203,12 +206,14 @@ public abstract class BaseTestCell {
         assertEquals(0, c.getRowIndex());
         assertEquals(1, c.getColumnIndex());
         c.setCellErrorValue(FormulaError.NULL.getCode());
+        assertEquals("B1 value == #NULL!", FormulaError.NULL.getCode(), c.getErrorCellValue());
 
         // C1
         c=r.createCell(2);
         assertEquals(0, c.getRowIndex());
         assertEquals(2, c.getColumnIndex());
         c.setCellErrorValue(FormulaError.DIV0.getCode());
+        assertEquals("C1 value == #DIV/0!", FormulaError.DIV0.getCode(), c.getErrorCellValue());
 
         Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1);
         wb1.close();
@@ -219,12 +224,16 @@ public abstract class BaseTestCell {
         assertEquals("Row 1 should have 2 cells", 2, r.getPhysicalNumberOfCells());
 
         c = r.getCell(1);
+        assertEquals(0, c.getRowIndex());
+        assertEquals(1, c.getColumnIndex());
         assertEquals(Cell.CELL_TYPE_ERROR, c.getCellType());
-        assertEquals("B2 value == #NULL!", FormulaError.NULL.getCode(), c.getErrorCellValue());
+        assertEquals("B1 value == #NULL!", FormulaError.NULL.getCode(), c.getErrorCellValue());
 
         c = r.getCell(2);
+        assertEquals(0, c.getRowIndex());
+        assertEquals(2, c.getColumnIndex());
         assertEquals(Cell.CELL_TYPE_ERROR, c.getCellType());
-        assertEquals("C2 value == #DIV/0!", FormulaError.DIV0.getCode(), c.getErrorCellValue());
+        assertEquals("C1 value == #DIV/0!", FormulaError.DIV0.getCode(), c.getErrorCellValue());
 
         wb2.close();
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message