]> source.dussan.org Git - poi.git/commitdiff
bug 59791: make sure hard-coded int literals work for cell type
authorJaven O'Neal <onealj@apache.org>
Mon, 22 Aug 2016 18:14:46 +0000 (18:14 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 22 Aug 2016 18:14:46 +0000 (18:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1757237 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java

index db46687c12b6f57cd9c41e5beb5f52163b855f45..406816958947fb05327bb3120a1b4d59c94da159 100644 (file)
@@ -1030,6 +1030,7 @@ public abstract class BaseTestCell {
         // Cell.CELL_TYPE_* -> CellType.*
         cell.setCellValue(5.0);
         assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCellType());
+        assertEquals(0, cell.getCellType()); //make sure that hard-coded int literals still work, even though users should be using the named constants
         assertEquals(CellType.NUMERIC, cell.getCellTypeEnum()); // make sure old way and new way are compatible
 
         // make sure switch(int|Enum) still works. Cases must be statically resolvable in Java 6 ("constant expression required")
@@ -1038,6 +1039,7 @@ public abstract class BaseTestCell {
                 // expected
                 break;
             case Cell.CELL_TYPE_STRING:
+            case Cell.CELL_TYPE_BOOLEAN:
             case Cell.CELL_TYPE_ERROR:
             case Cell.CELL_TYPE_FORMULA:
             case Cell.CELL_TYPE_BLANK: