aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi/xwpf
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2010-06-29 13:38:24 +0000
committerNick Burch <nick@apache.org>2010-06-29 13:38:24 +0000
commitf69404de8d0b8d974b9eefe8411f1ce7620bb15c (patch)
tree94f9dddde372b7d1f3c5215cf3f8885b2e79793a /src/ooxml/testcases/org/apache/poi/xwpf
parentb75c47e1e5917ec141544d3de00546ed09997d29 (diff)
downloadpoi-f69404de8d0b8d974b9eefe8411f1ce7620bb15c.tar.gz
poi-f69404de8d0b8d974b9eefe8411f1ce7620bb15c.zip
Fix bug #49446 - Don't consider 17.16.23 field codes as properly part of the paragraph's text
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@958965 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java13
1 files changed, 13 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 f98d5e69ca..2277ecec9d 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
@@ -237,4 +237,17 @@ public class TestXWPFWordExtractor extends TestCase {
// Now check the first paragraph in total
assertTrue(extractor.getText().contains("a\tb\n"));
}
+
+ /**
+ * The output should not contain field codes, e.g. those specified in the
+ * w:instrText tag (spec sec. 17.16.23)
+ */
+ public void testNoFieldCodes() {
+ XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("FieldCodes.docx");
+ XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
+ String text = extractor.getText();
+ assertTrue(text.length() > 0);
+ assertFalse(text.contains("AUTHOR"));
+ assertFalse(text.contains("CREATEDATE"));
+ }
}