poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1720588 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java test-data/spreadsheet/58747.xlsx
Date Thu, 17 Dec 2015 15:05:06 GMT
Author: nick
Date: Thu Dec 17 15:05:06 2015
New Revision: 1720588

URL: http://svn.apache.org/viewvc?rev=1720588&view=rev
Log:
Unit test for non-reproducable #58747

Added:
    poi/trunk/test-data/spreadsheet/58747.xlsx   (with props)
Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java?rev=1720588&r1=1720587&r2=1720588&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java Thu
Dec 17 15:05:06 2015
@@ -27,6 +27,7 @@ import org.apache.poi.openxml4j.opc.OPCP
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.xssf.model.CommentsTable;
+import org.apache.poi.xssf.model.StylesTable;
 import org.apache.poi.xssf.usermodel.XSSFRichTextString;
 import org.apache.poi.xssf.usermodel.XSSFShape;
 import org.apache.poi.xssf.usermodel.XSSFSimpleShape;
@@ -196,4 +197,22 @@ public final class TestXSSFReader extend
        assertTrue(text.indexOf("Line 3") > -1);
 
    }
+   
+   /**
+    * NPE from XSSFReader$SheetIterator.<init> on XLSX files generated by 
+    *  the openpyxl library
+    */
+   public void test58747() throws Exception {
+       OPCPackage pkg =  XSSFTestDataSamples.openSamplePackage("58747.xlsx");
+       ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg);
+       XSSFReader reader = new XSSFReader(pkg);
+       StylesTable styles = reader.getStylesTable();
+       
+       XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData();
+       assertEquals(true, iter.hasNext());
+       iter.next();
+       
+       assertEquals(false, iter.hasNext());
+       assertEquals("Orders", iter.getSheetName());
+   }
 }

Added: poi/trunk/test-data/spreadsheet/58747.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/58747.xlsx?rev=1720588&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/58747.xlsx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message