poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r1305812 - in /poi/trunk: src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java test-data/slideshow/badzip.ppt
Date Tue, 27 Mar 2012 11:29:39 GMT
Author: maxcom
Date: Tue Mar 27 11:29:39 2012
New Revision: 1305812

URL: http://svn.apache.org/viewvc?rev=1305812&view=rev
Log:
unit test for #52991 (unexpected end of ZLIB input stream)

Added:
    poi/trunk/test-data/slideshow/badzip.ppt   (with props)
Modified:
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java?rev=1305812&r1=1305811&r2=1305812&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java Tue
Mar 27 11:29:39 2012
@@ -17,6 +17,7 @@
 
 package org.apache.poi.hslf.extractor;
 
+import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.util.List;
 
@@ -31,6 +32,7 @@ import org.apache.poi.hwpf.HWPFDocument;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.util.IOUtils;
 
 /**
  * Tests that the extractor correctly gets the text out of our sample file
@@ -203,7 +205,20 @@ public final class TestExtractor extends
          assertEquals("Expected 2 embedded Excel Spreadsheets", 2, num_xls);
          assertEquals("Expected 2 embedded PowerPoint Presentations", 2, num_ppt);
      }
-    
+
+    /**
+     * A powerpoint file with embeded powerpoint files
+     */
+    public void test52991() throws Exception {
+        String path = "badzip.ppt";
+        ppe = new PowerPointExtractor(POIDataSamples.getSlideShowInstance().openResourceAsStream(path));
+        List<OLEShape> shapes = ppe.getOLEShapes();
+        
+        for (OLEShape shape : shapes) {
+            IOUtils.copy(shape.getObjectData().getData(), new ByteArrayOutputStream());
+        }
+    }
+
     /**
      * From bug #45543
      */

Added: poi/trunk/test-data/slideshow/badzip.ppt
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/badzip.ppt?rev=1305812&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/slideshow/badzip.ppt
------------------------------------------------------------------------------
    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