Lines 79-84
Link Here
|
79 |
assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING, |
79 |
assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING, |
80 |
CellType.FORMULA, CellType.ERROR); |
80 |
CellType.FORMULA, CellType.ERROR); |
81 |
|
81 |
|
|
|
82 |
cell.setCellValue(Integer.valueOf(42)); |
83 |
assertEquals(42, cell.getNumericCellValue(), 0.0001); |
84 |
assertEquals(CellType.NUMERIC, cell.getCellType()); |
85 |
assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING, |
86 |
CellType.FORMULA, CellType.ERROR); |
87 |
|
82 |
cell.setCellValue(false); |
88 |
cell.setCellValue(false); |
83 |
assertFalse(cell.getBooleanCellValue()); |
89 |
assertFalse(cell.getBooleanCellValue()); |
84 |
assertEquals(CellType.BOOLEAN, cell.getCellType()); |
90 |
assertEquals(CellType.BOOLEAN, cell.getCellType()); |
Lines 86-91
Link Here
|
86 |
assertTrue(cell.getBooleanCellValue()); |
92 |
assertTrue(cell.getBooleanCellValue()); |
87 |
assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.STRING, CellType.BOOLEAN, |
93 |
assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.STRING, CellType.BOOLEAN, |
88 |
CellType.FORMULA, CellType.ERROR); |
94 |
CellType.FORMULA, CellType.ERROR); |
|
|
95 |
|
96 |
cell.setCellValue(Boolean.valueOf(false)); |
97 |
assertFalse(cell.getBooleanCellValue()); |
98 |
assertEquals(CellType.BOOLEAN, cell.getCellType()); |
99 |
cell.setCellValue(Boolean.valueOf(true)); |
100 |
assertTrue(cell.getBooleanCellValue()); |
101 |
assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.STRING, CellType.BOOLEAN, |
102 |
CellType.FORMULA, CellType.ERROR); |
89 |
|
103 |
|
90 |
cell.setCellValue(factory.createRichTextString("Foo")); |
104 |
cell.setCellValue(factory.createRichTextString("Foo")); |
91 |
assertEquals("Foo", cell.getRichStringCellValue().getString()); |
105 |
assertEquals("Foo", cell.getRichStringCellValue().getString()); |
Lines 138-143
Link Here
|
138 |
cell.setCellValue((String)null); |
152 |
cell.setCellValue((String)null); |
139 |
assertEquals("", cell.getStringCellValue()); |
153 |
assertEquals("", cell.getStringCellValue()); |
140 |
assertEquals(CellType.BLANK, cell.getCellType()); |
154 |
assertEquals(CellType.BLANK, cell.getCellType()); |
|
|
155 |
|
156 |
cell.setCellValue((Number)null); |
157 |
assertEquals("", cell.getStringCellValue()); |
158 |
assertEquals(CellType.BLANK, cell.getCellType()); |
159 |
|
160 |
cell.setCellValue((Boolean)null); |
161 |
assertEquals("", cell.getStringCellValue()); |
162 |
assertEquals(CellType.BLANK, cell.getCellType()); |
141 |
|
163 |
|
142 |
cell.setCellValue((LocalDate)null); |
164 |
cell.setCellValue((LocalDate)null); |
143 |
assertNull(cell.getLocalDateTimeCellValue()); |
165 |
assertNull(cell.getLocalDateTimeCellValue()); |