diff options
author | Nick Burch <nick@apache.org> | 2012-01-11 15:51:10 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2012-01-11 15:51:10 +0000 |
commit | 9d68c28c694fbc7f0d8614a81d557cec3b93c295 (patch) | |
tree | b585817b1dd5d3121882b7749f858144562cb5f0 /src/ooxml/testcases | |
parent | 57c4509faabf7025bc52ecfe90684512b2cf01a4 (diff) | |
download | poi-9d68c28c694fbc7f0d8614a81d557cec3b93c295.tar.gz poi-9d68c28c694fbc7f0d8614a81d557cec3b93c295.zip |
POIXMLPropertiesTextExtractor support for extracting custom OOXML properties as text
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1230106 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java b/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java index b19477f04c..8ad2f78c4b 100644 --- a/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java @@ -84,8 +84,21 @@ public final class TestXMLPropertiesTextExtractor extends TestCase { assertTrue(eText.contains("Company = Mera")); } - public void testCustom() { - // TODO! + public void testCustom() throws Exception { + OPCPackage pkg = OPCPackage.open( + _ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm") + ); + XSSFWorkbook wb = new XSSFWorkbook(pkg); + + POIXMLPropertiesTextExtractor ext = new POIXMLPropertiesTextExtractor(wb); + ext.getText(); + + // Now check + String text = ext.getText(); + String cText = ext.getCustomPropertiesText(); + + assertTrue(text.contains("description = another value")); + assertTrue(cText.contains("description = another value")); } /** |