You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/03/11 20:53:26 UTC

svn commit: r1665984 - /poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java

Author: centic
Date: Wed Mar 11 19:53:26 2015
New Revision: 1665984

URL: http://svn.apache.org/r1665984
Log:
Add helper test to verify that vsdx cannot even be loaded by POIXMLDocument curently.

Modified:
    poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java?rev=1665984&r1=1665983&r2=1665984&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler.java Wed Mar 11 19:53:26 2015
@@ -20,9 +20,16 @@ import static org.junit.Assert.assertNot
 
 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;
+		}
+	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Re: svn commit: r1665984 - /poi/trunk/src/integrationtest/org/apache/poi/stress/POIXMLDocumentHandler .java

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 11 Mar 2015, centic@apache.org wrote:
> Log:
> Add helper test to verify that vsdx cannot even be loaded by 
> POIXMLDocument curently.

The Visio OOXML files use a different relationship for the core, which is 
probably why. If someone does want to add support for them, we'd probably 
want to take the relationship definition I've added to ExtractorFactory 
and put it somewhere more general, then update the code to try both the 
normal office one, and otherwise the new visio one

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org