diff options
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java | 29 |
1 files changed, 29 insertions, 0 deletions
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<PackagePart> getAllEmbedds() throws OpenXML4JException { + return null; + } + } } |