You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2017/06/09 12:47:03 UTC

svn commit: r1798200 - in /poi/trunk: src/integrationtest/org/apache/poi/TestAllFiles.java src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java test-data/document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC

Author: centic
Date: Fri Jun  9 12:47:03 2017
New Revision: 1798200

URL: http://svn.apache.org/viewvc?rev=1798200&view=rev
Log:
Bug 60374: Add test for ArrayIndexOutOfBounds on old Word Documents due to Non-Unicode

Added:
    poi/trunk/test-data/document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC   (with props)
Modified:
    poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1798200&r1=1798199&r2=1798200&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Fri Jun  9 12:47:03 2017
@@ -230,10 +230,10 @@ public class TestAllFiles {
         FILE_PASSWORD = Collections.unmodifiableMap(passmap);
     }
 
-    private static final Set<String> unmodifiableHashSet(String... a) {
+    private static Set<String> unmodifiableHashSet(String... a) {
         return Collections.unmodifiableSet(hashSet(a));
     }
-    private static final Set<String> hashSet(String... a) {
+    private static Set<String> hashSet(String... a) {
         return new HashSet<String>(Arrays.asList(a));
     }
 
@@ -249,6 +249,7 @@ public class TestAllFiles {
         "document/Bug60936.doc",
         "document/Bug60942.doc",
         "document/Bug60942b.doc",
+        "document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC",
         "hpsf/TestMickey.doc",
         "document/52117.doc",
         "hpsf/TestInvertedClassID.doc",

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java?rev=1798200&r1=1798199&r2=1798200&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java Fri Jun  9 12:47:03 2017
@@ -17,11 +17,16 @@
 
 package org.apache.poi.hwpf.extractor;
 
+import org.apache.poi.POIDataSamples;
+import org.apache.poi.POITextExtractor;
+import org.apache.poi.extractor.OLE2ExtractorFactory;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
+import org.junit.Test;
+
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.poi.POIDataSamples;
-import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
 
 /**
  * Tests for bugs with the WordExtractor
@@ -52,4 +57,15 @@ public final class TestWordExtractorBugs
         extractor.getText();
         extractor.close();
     }
+
+    @Test
+    public void testBug60374() throws Exception {
+        NPOIFSFileSystem fs = new NPOIFSFileSystem(SAMPLES.openResourceAsStream("cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC"));
+        final POITextExtractor extractor = OLE2ExtractorFactory.createExtractor(fs);
+
+        // Check it gives text without error
+        assertNotNull(extractor.getText());
+
+        extractor.close();
+    }
 }

Added: poi/trunk/test-data/document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC?rev=1798200&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/document/cn.orthodox.www_divenbog_APRIL_30-APRIL.DOC
------------------------------------------------------------------------------
    svn:mime-type = application/msword



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