Add test-case which shows that bug 55814 is fixed already by other changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
48d6e6c9cf
commit
4d13aefd6e
@ -313,6 +313,39 @@ public final class TestXSSFComment extends BaseTestCellComment {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug55814() throws IOException {
|
||||
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("55814.xlsx")) {
|
||||
|
||||
int oldsheetIndex = wb.getSheetIndex("example");
|
||||
Sheet oldsheet = wb.getSheetAt(oldsheetIndex);
|
||||
|
||||
Comment comment = oldsheet.getRow(0).getCell(0).getCellComment();
|
||||
assertEquals("Comment Here\n", comment.getString().getString());
|
||||
|
||||
Sheet newsheet = wb.cloneSheet(oldsheetIndex);
|
||||
|
||||
wb.removeSheetAt(oldsheetIndex);
|
||||
|
||||
//wb.write(new FileOutputStream("/tmp/outnocomment.xlsx"));
|
||||
|
||||
comment = newsheet.getRow(0).getCell(0).getCellComment();
|
||||
assertNotNull("Should have a comment on A1 in the new sheet", comment);
|
||||
assertEquals("Comment Here\n", comment.getString().getString());
|
||||
|
||||
Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||
assertNotNull(wbBack);
|
||||
wbBack.close();
|
||||
}
|
||||
|
||||
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("55814.xlsx")) {
|
||||
int oldsheetIndex = wb.getSheetIndex("example");
|
||||
Sheet newsheet = wb.getSheetAt(oldsheetIndex);
|
||||
Comment comment = newsheet.getRow(0).getCell(0).getCellComment();
|
||||
assertEquals("Comment Here\n", comment.getString().getString());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bug57838DeleteRowsWthCommentsBug() throws IOException {
|
||||
Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57838.xlsx");
|
||||
|
BIN
test-data/spreadsheet/55814.xlsx
Normal file
BIN
test-data/spreadsheet/55814.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user