]> source.dussan.org Git - poi.git/commitdiff
Add test that shows we can already extract text from .docm files
authorNick Burch <nick@apache.org>
Wed, 4 Nov 2009 01:35:55 +0000 (01:35 +0000)
committerNick Burch <nick@apache.org>
Wed, 4 Nov 2009 01:35:55 +0000 (01:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@832644 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java

index a3a4c944f7bed4d8bcf9490ca083e98fd8e99e75..ddc0957aa0c39e624a5591d3539999e13f2c4d16 100644 (file)
@@ -207,4 +207,16 @@ public class TestXWPFWordExtractor extends TestCase {
         assertTrue(extractor.getText().contains("Section 3"));
     }
 
+    /**
+     * Test that we can open and process .docm
+     *  (macro enabled) docx files (bug #45690)
+     */
+    public void testDOCMFiles() {
+        XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("45690.docm");
+        XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
+
+        assertTrue(extractor.getText().contains("2004"));
+        assertTrue(extractor.getText().contains("2008"));
+        assertTrue(extractor.getText().contains("(120 "));
+    }
 }