Browse Source

Test which seems to show that bug #44996 is invalid, but not completely sure

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@658336 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_2_FINAL
Nick Burch 16 years ago
parent
commit
9b5e20d769
1 changed files with 24 additions and 0 deletions
  1. 24
    0
      src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java

+ 24
- 0
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java View File

@@ -58,6 +58,30 @@ public final class TestHSSFCell extends TestCase {
}
}
public void testSetValues() throws Exception {
HSSFWorkbook book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet("test");
HSSFRow row = sheet.createRow(0);

HSSFCell cell = row.createCell((short)0);
cell.setCellValue(1.2);
assertEquals(1.2, cell.getNumericCellValue(), 0.0001);
assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cell.getCellType());
cell.setCellValue(false);
assertEquals(false, cell.getBooleanCellValue());
assertEquals(HSSFCell.CELL_TYPE_BOOLEAN, cell.getCellType());
cell.setCellValue(new HSSFRichTextString("Foo"));
assertEquals("Foo", cell.getRichStringCellValue().getString());
assertEquals(HSSFCell.CELL_TYPE_STRING, cell.getCellType());
cell.setCellValue(new HSSFRichTextString("345"));
assertEquals("345", cell.getRichStringCellValue().getString());
assertEquals(HSSFCell.CELL_TYPE_STRING, cell.getCellType());
}
/**
* test that Boolean and Error types (BoolErrRecord) are supported properly.
*/

Loading…
Cancel
Save