diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2016-12-31 21:50:47 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2016-12-31 21:50:47 +0000 |
commit | 6a4428260860c2dab150c03c4ca7579f6a1cc518 (patch) | |
tree | 3c2d874da1351e2ffcb15359ce12e852a08ebd80 /src/integrationtest/org | |
parent | 155bc83d5833218489017237a0ff519f73041db1 (diff) | |
download | poi-6a4428260860c2dab150c03c4ca7579f6a1cc518.tar.gz poi-6a4428260860c2dab150c03c4ca7579f6a1cc518.zip |
#60519 - Extractor for *SSF embeddings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1776819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org')
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java b/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java index 123bfa7450..854dbf2fba 100644 --- a/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java +++ b/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java @@ -23,6 +23,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.ss.extractor.EmbeddedData; +import org.apache.poi.ss.extractor.EmbeddedExtractor; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; @@ -55,6 +57,8 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler { readContent(read); + extractEmbedded(read); + modifyContent(read); read.close(); @@ -91,6 +95,18 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler { } } } + + private void extractEmbedded(Workbook wb) throws IOException { + EmbeddedExtractor ee = new EmbeddedExtractor(); + + for (Sheet s : wb) { + for (EmbeddedData ed : ee.extractAll(s)) { + assertNotNull(ed.getFilename()); + assertNotNull(ed.getEmbeddedData()); + assertNotNull(ed.getShape()); + } + } + } private void modifyContent(Workbook wb) { /* a number of file fail because of various things: udf, unimplemented functions, ... |