Tried to reproduce Bug 47090, but seems to be fixed now.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1516982 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2013-08-23 18:56:32 +00:00
parent f06e06ef12
commit 57de5b995d
2 changed files with 46 additions and 0 deletions

View File

@ -528,4 +528,50 @@ public final class TestXSSFWorkbook extends BaseTestWorkbook {
}
System.out.println("Done");
}
public void testBug47090a() {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(0);
assertSheetOrder(workbook, "Sheet2");
workbook.createSheet();
assertSheetOrder(workbook, "Sheet2", "Sheet1");
Workbook read = XSSFTestDataSamples.writeOutAndReadBack(workbook);
assertSheetOrder(read, "Sheet2", "Sheet1");
}
public void testBug47090b() {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(1);
assertSheetOrder(workbook, "Sheet1");
workbook.createSheet();
assertSheetOrder(workbook, "Sheet1", "Sheet0"); // Sheet0 because it uses "Sheet" + sheets.size() as starting point!
Workbook read = XSSFTestDataSamples.writeOutAndReadBack(workbook);
assertSheetOrder(read, "Sheet1", "Sheet0");
}
public void testBug47090c() {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(0);
assertSheetOrder(workbook, "Sheet2");
workbook.cloneSheet(0);
assertSheetOrder(workbook, "Sheet2", "Sheet2 (2)");
Workbook read = XSSFTestDataSamples.writeOutAndReadBack(workbook);
assertSheetOrder(read, "Sheet2", "Sheet2 (2)");
}
public void testBug47090d() {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.createSheet();
assertSheetOrder(workbook, "Sheet1", "Sheet2", "Sheet0");
workbook.removeSheetAt(0);
assertSheetOrder(workbook, "Sheet2", "Sheet0");
workbook.createSheet();
assertSheetOrder(workbook, "Sheet2", "Sheet0", "Sheet1");
Workbook read = XSSFTestDataSamples.writeOutAndReadBack(workbook);
assertSheetOrder(read, "Sheet2", "Sheet0", "Sheet1");
}
}

Binary file not shown.