Fix unit test for Bug 50298 some more

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1516320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2013-08-21 22:57:26 +00:00
parent f0a8bc9281
commit 37b7f408a3

View File

@ -922,10 +922,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
assertEquals("Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected, assertEquals("Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected,
expected, written); expected, written);
ByteArrayOutputStream out = new ByteArrayOutputStream(); HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
wb.write(out);
HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
assertSheetOrder(read, "Invoice", "Invoice1", "Digest", "Deferred", "Received"); assertSheetOrder(read, "Invoice", "Invoice1", "Digest", "Deferred", "Received");
} }
@ -965,11 +962,8 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
assertEquals("Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected, assertEquals("Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected,
expected, written); expected, written);
ByteArrayOutputStream out = new ByteArrayOutputStream(); HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
wb.write(out); assertSheetOrder(read, "Invoice", "Deferred", "Received", "Digest");
HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
assertSheetOrder(wb, "Invoice", "Deferred", "Received", "Digest");
} }
private void assertSheetOrder(HSSFWorkbook wb, String... sheets) { private void assertSheetOrder(HSSFWorkbook wb, String... sheets) {