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 da0b4d1b3a
commit cb6ca3554d
1 changed files with 3 additions and 9 deletions

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,
expected, written);
ByteArrayOutputStream out = new ByteArrayOutputStream();
wb.write(out);
HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
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,
expected, written);
ByteArrayOutputStream out = new ByteArrayOutputStream();
wb.write(out);
HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
assertSheetOrder(wb, "Invoice", "Deferred", "Received", "Digest");
HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
assertSheetOrder(read, "Invoice", "Deferred", "Received", "Digest");
}
private void assertSheetOrder(HSSFWorkbook wb, String... sheets) {