Border borderbase4 = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.IN);
try {
SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
.getTestResourceAsStream(filename));
Table table = doc.getTableByName("A");
Cell cell1 = table.getCellByPosition("A8");
Border border1 = cell1.getBorder(CellBordersType.BOTTOM);
Border border11 = cell1.getBorder(CellBordersType.LEFT);
Assert.assertEquals(borderbase1, border1);
Assert.assertEquals(borderbase1, border11);
Cell cell2 = table.getCellByPosition("A10");
Border border2 = cell2.getBorder(CellBordersType.TOP);
Assert.assertEquals(borderbase2, border2);
Border border3 = cell2.getBorder(CellBordersType.DIAGONALBLTR);
Assert.assertEquals(borderbase3, border3);
Cell cell3 = table.getCellByPosition("A12");
Border border4 = cell3.getBorder(CellBordersType.LEFT);
Border border41 = cell3.getBorder(CellBordersType.RIGHT);
Assert.assertEquals(borderbase4, border4);
Assert.assertEquals(borderbase4, border41);
Cell cell4 = table.getCellByPosition("B8");
cell4.setBorders(CellBordersType.ALL_FOUR, borderbase1);
Border border5 = cell4.getBorder(CellBordersType.BOTTOM);
Border border51 = cell4.getBorder(CellBordersType.LEFT);
Assert.assertEquals(borderbase1, border5);
Assert.assertEquals(borderbase1, border51);
Cell cell5 = table.getCellByPosition("B10");
cell5.setBorders(CellBordersType.TOP, borderbase2);
cell5.setBorders(CellBordersType.DIAGONALBLTR, borderbase3);
Assert.assertEquals(borderbase2, cell5.getBorder(CellBordersType.TOP));
Assert.assertEquals(borderbase3, cell5.getBorder(CellBordersType.DIAGONALBLTR));
Cell cell6 = table.getCellByPosition("B12");
cell6.setBorders(CellBordersType.LEFT_RIGHT, borderbase4);
Assert.assertEquals(borderbase4, cell6.getBorder(CellBordersType.LEFT));
Assert.assertEquals(borderbase4, cell6.getBorder(CellBordersType.RIGHT));
} catch (Exception e) {
e.printStackTrace();
Assert.fail();
}