From: Dominik Stadler Date: Wed, 11 Mar 2015 19:53:26 +0000 (+0000) Subject: Add helper test to verify that vsdx cannot even be loaded by POIXMLDocument curently. X-Git-Tag: REL_3_12_FINAL~83 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=44d37a24ade3758fda609083bdcec67f8a4a2d50;p=poi.git Add helper test to verify that vsdx cannot even be loaded by POIXMLDocument curently. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1665984 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java b/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java index 103bb9be7e..c720272352 100644 --- a/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java +++ b/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java @@ -20,9 +20,16 @@ import static org.junit.Assert.assertNotNull; import java.io.IOException; import java.io.InputStream; +import java.util.List; import org.apache.poi.POIXMLDocument; +import org.apache.poi.openxml4j.exceptions.OpenXML4JException; +import org.apache.poi.openxml4j.opc.OPCPackage; +import org.apache.poi.openxml4j.opc.PackageAccess; +import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.junit.Ignore; +import org.junit.Test; public final class POIXMLDocumentHandler { protected void handlePOIXMLDocument(POIXMLDocument doc) throws Exception { @@ -43,4 +50,26 @@ public final class POIXMLDocumentHandler { } return false; } + + // a test-case to test this locally without executing the full TestAllFiles + @Ignore("POIXMLDocument cannot handle this Visio file currently...") + @Test + public void test() throws Exception { + OPCPackage pkg = OPCPackage.open("test-data/diagram/test.vsdx", PackageAccess.READ); + try { + handlePOIXMLDocument(new TestPOIXMLDocument(pkg)); + } finally { + pkg.close(); + } + } + + private final static class TestPOIXMLDocument extends POIXMLDocument { + public TestPOIXMLDocument(OPCPackage pkg) { + super(pkg); + } + + public List getAllEmbedds() throws OpenXML4JException { + return null; + } + } }