public void testSetBorders() {
try {
Border borderbase = new Border(Color.LIME, 1.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
Table table = doc.getTableByName("Sheet1");
Cell cell = table.getCellByPosition(2, 2);
cell.setBorders(CellBordersType.BOTTOM, borderbase);
cell.setBorders(CellBordersType.RIGHT, borderbase);
cell.setBorders(CellBordersType.DIAGONALTLBR, borderbase);
//verification
Border base = cell.getBorder(CellBordersType.BOTTOM);
base = cell.getBorder(CellBordersType.RIGHT);
base = cell.getBorder(CellBordersType.DIAGONALTLBR);
Assert.assertEquals(borderbase, base);
Assert.assertEquals(StyleTypeDefinitions.LineType.SINGLE, borderbase.getLineStyle());
//save
doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
Assert.fail(e.getMessage());
}
}