]> source.dussan.org Git - poi.git/commitdiff
bug 60601: allow SXSSFITestDataProvider.writeOutAndReadBack(Workbook wb) to work...
authorJaven O'Neal <onealj@apache.org>
Thu, 19 Jan 2017 08:51:04 +0000 (08:51 +0000)
committerJaven O'Neal <onealj@apache.org>
Thu, 19 Jan 2017 08:51:04 +0000 (08:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1779433 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java

index 4f2eb40f911b82bf9b95fb1b2b5fdeca06e3f330..ab84979d09d16ae810a297305d9fd0c2cfbf2216 100644 (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");
         }