bug 60601: allow SXSSFITestDataProvider.writeOutAndReadBack(Workbook wb) to work on SXSSFWorkbooks and XSSFWorkbooks

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1779433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-01-19 08:51:04 +00:00
parent 45de2e444a
commit b2e807c005
1 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,10 @@ public final class SXSSFITestDataProvider implements ITestDataProvider {
*/
@Override
public XSSFWorkbook writeOutAndReadBack(Workbook wb) {
if(!(wb instanceof SXSSFWorkbook)) {
// wb is usually an SXSSFWorkbook, but must also work on an XSSFWorkbook
// since workbooks must be able to be written out and read back
// several times in succession
if(!(wb instanceof SXSSFWorkbook || wb instanceof XSSFWorkbook)) {
throw new IllegalArgumentException("Expected an instance of SXSSFWorkbook");
}