poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1141961 - in /poi/trunk: src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java test-data/spreadsheet/51461.xls
Date Fri, 01 Jul 2011 15:16:15 GMT
Author: nick
Date: Fri Jul  1 15:16:09 2011
New Revision: 1141961

URL: http://svn.apache.org/viewvc?rev=1141961&view=rev
Log:
Add unit test that seems to show bug #51461 working just fine

Added:
    poi/trunk/test-data/spreadsheet/51461.xls   (with props)
Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=1141961&r1=1141960&r2=1141961&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Fri Jul  1 15:16:09
2011
@@ -25,6 +25,8 @@ import org.apache.poi.hssf.model.Interna
 import org.apache.poi.hssf.record.*;
 import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate;
 import org.apache.poi.hssf.record.common.UnicodeString;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.ss.formula.ptg.Area3DPtg;
 import org.apache.poi.ss.formula.ptg.DeletedArea3DPtg;
 import org.apache.poi.ss.formula.ptg.Ptg;
@@ -2123,4 +2125,20 @@ if(1==2) {
        wb = writeOutAndReadBack(wb);
        assertEquals(1, wb.getNumberOfSheets());
     }
+    
+    /**
+     * File with exactly 256 data blocks (+header block)
+     *  shouldn't break on POIFS loading 
+     */
+    public void test51461() throws Exception {
+       byte[] data = HSSFITestDataProvider.instance.getTestDataFileContent("51461.xls");
+       
+       HSSFWorkbook wbPOIFS = new HSSFWorkbook(new POIFSFileSystem(
+             new ByteArrayInputStream(data)).getRoot(), false);
+       HSSFWorkbook wbNPOIFS = new HSSFWorkbook(new NPOIFSFileSystem(
+             new ByteArrayInputStream(data)).getRoot(), false);
+       
+       assertEquals(2, wbPOIFS.getNumberOfSheets());
+       assertEquals(2, wbNPOIFS.getNumberOfSheets());
+    }
 }

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

Propchange: poi/trunk/test-data/spreadsheet/51461.xls
------------------------------------------------------------------------------
    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