[95903] XML Catalog extension points should support locations with jar: protocol
diff --git a/tests/org.eclipse.wst.xml.catalog.tests/data/schemas.jar b/tests/org.eclipse.wst.xml.catalog.tests/data/schemas.jar new file mode 100644 index 0000000..9d1e4da --- /dev/null +++ b/tests/org.eclipse.wst.xml.catalog.tests/data/schemas.jar Binary files differ
diff --git a/tests/org.eclipse.wst.xml.catalog.tests/plugin.xml b/tests/org.eclipse.wst.xml.catalog.tests/plugin.xml index 4c75c79..ca8ffe8 100644 --- a/tests/org.eclipse.wst.xml.catalog.tests/plugin.xml +++ b/tests/org.eclipse.wst.xml.catalog.tests/plugin.xml
@@ -20,6 +20,10 @@ name="http://www.w3.org/2001/XMLSchema" uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd"> </uri> + <uri id="testURIId3" + name="http://oasis.names.tc.entity.xmlns.xml.catalog" + uri="jar:platform:/plugin/org.eclipse.wst.xml.catalog.tests/data/schemas.jar!/data/catalog.xsd"> + </uri> <nextCatalog id="testNestedCatalog" catalog="data/catalog1.xml"/> </catalogContribution>
diff --git a/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/CatalogContributorRegistryReaderTest.java b/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/CatalogContributorRegistryReaderTest.java index bcc6f3f..e5c80f7 100644 --- a/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/CatalogContributorRegistryReaderTest.java +++ b/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/CatalogContributorRegistryReaderTest.java
@@ -40,7 +40,6 @@ for (int i = 0; i < entries.size(); i++) { ICatalogEntry entry = (ICatalogEntry)entries.get(i); - assertNotNull(entry.getId()); if("testSystemId".equals(entry.getId())) { String resolvedURI = resolvePath(pluginId, "data/Personal/personal.dtd"); @@ -90,6 +89,12 @@ assertEquals(resolvedURI, entry.getURI()); assertEquals("http://www.w3.org/2001/XMLSchema", entry.getKey()); } + else if("testURIId3".equals(entry.getId())) + { + String resolvedURI = resolvePath(pluginId, "jar:platform:/plugin/org.eclipse.wst.xml.catalog.tests/data/schemas.jar!/data/catalog.xsd"); + assertEquals(resolvedURI, entry.getURI()); + assertEquals("http://oasis.names.tc.entity.xmlns.xml.catalog", entry.getKey()); + } } // test tested catalog
diff --git a/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/ZipTest.java b/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/ZipTest.java new file mode 100644 index 0000000..dca8739 --- /dev/null +++ b/tests/org.eclipse.wst.xml.catalog.tests/src/org/eclipse/wst/xml/catalog/tests/internal/ZipTest.java
@@ -0,0 +1,15 @@ +package org.eclipse.wst.xml.catalog.tests.internal; + +import java.io.InputStream; +import java.net.URL; + +import junit.framework.TestCase; + +public class ZipTest extends TestCase { + + public void testZip() throws Exception{ + + URL url = new URL("jar:file:/D:/tcs/catalogJarTest/schemas.jar!/data/catalog.xsd"); + InputStream is = url.openStream(); + } +}