\r
wb.close();\r
}\r
+ \r
+ @Test(expected=RuntimeException.class)\r
+ public void setCellStylePropertyWithInvalidValue() throws IOException {\r
+ Workbook wb = _testDataProvider.createWorkbook();\r
+ Sheet s = wb.createSheet();\r
+ Row r = s.createRow(0);\r
+ Cell c = r.createCell(0);\r
+\r
+ // An invalid BorderStyle constant\r
+ CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, 42);\r
+ \r
+ wb.close();\r
+ }\r
+ \r
+ @Test()\r
+ public void setCellStylePropertyBorderWithShortAndEnum() throws IOException {\r
+ Workbook wb = _testDataProvider.createWorkbook();\r
+ Sheet s = wb.createSheet();\r
+ Row r = s.createRow(0);\r
+ Cell c = r.createCell(0);\r
+\r
+ // A valid BorderStyle constant, as a Short\r
+ CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, BorderStyle.DASH_DOT.getCode());\r
+ assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottom());\r
+ \r
+ // A valid BorderStyle constant, as an Enum\r
+ CellUtil.setCellStyleProperty(c, CellUtil.BORDER_TOP, BorderStyle.MEDIUM_DASH_DOT);\r
+ assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTop());\r
+ \r
+ wb.close();\r
+ }\r
\r
@Test\r
public void setCellStyleProperties() throws IOException {\r