aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Valyanskiy <maxcom@apache.org>2011-06-22 12:46:42 +0000
committerMaxim Valyanskiy <maxcom@apache.org>2011-06-22 12:46:42 +0000
commit4f7427a355414ba7192da451d352258360494fdb (patch)
treec964758bdaa5c629d72ddf542da4c59fa3a8f6ea
parent21885a6fd5da01551cf8dd22a7e9af919250bed9 (diff)
downloadpoi-4f7427a355414ba7192da451d352258360494fdb.tar.gz
poi-4f7427a355414ba7192da451d352258360494fdb.zip
Test for parsing document with drawings to prevent NoClassDefFoundError for CTAnchor in XWPFRun
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1138440 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java11
-rw-r--r--test-data/document/drawing.docxbin0 -> 95247 bytes
2 files changed, 11 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
index 57a67eab6b..46188f5ed8 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
@@ -270,4 +270,15 @@ public class TestXWPFWordExtractor extends TestCase {
assertTrue(text.length() > 0);
assertTrue(text.contains("FldSimple.docx"));
}
+
+ /**
+ * Test for parsing document with drawings to prevent
+ * NoClassDefFoundError for CTAnchor in XWPFRun
+ */
+ public void testDrawings() throws IOException {
+ XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("drawing.docx");
+ XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
+ String text = extractor.getText();
+ assertTrue(text.length() > 0);
+ }
}
diff --git a/test-data/document/drawing.docx b/test-data/document/drawing.docx
new file mode 100644
index 0000000000..23546b7f2c
--- /dev/null
+++ b/test-data/document/drawing.docx
Binary files differ