Search in sources :

Example 1 with HumboldtURIResolver

use of eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver in project hale by halestudio.

the class HumboldtURIResolverTest method testFileRelative1.

@SuppressWarnings("javadoc")
@Test
public void testFileRelative1() {
    String baseUri = "file:///C:/Test/gml/3.2.1/feature.xsd";
    String location = "gml.xsd";
    String expected = "/C:/Test/gml/3.2.1/gml.xsd";
    HumboldtURIResolver resolver = new HumboldtURIResolver();
    InputSource source = resolver.resolveEntity("ns", location, baseUri);
    assertEquals(expected, source.getSystemId());
}
Also used : InputSource(org.xml.sax.InputSource) HumboldtURIResolver(eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver) Test(org.junit.Test)

Example 2 with HumboldtURIResolver

use of eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver in project hale by halestudio.

the class HumboldtURIResolverTest method testJarURI.

@SuppressWarnings("javadoc")
@Test
public void testJarURI() {
    String baseUri = "jar:file:/home/simon/.gradle/caches/modules-2/files-2.1/eu.esdihumboldt.hale/eu.esdihumboldt.hale.io.xsd/2.9.5-SNAPSHOT/fe32ccb0764ec0adcfab7563b3d84e46c36bd3a0/eu.esdihumboldt.hale.io.xsd-2.9.5-SNAPSHOT.jar!/schemas/";
    String location = "xml.xsd";
    String expected = "jar:file:/home/simon/.gradle/caches/modules-2/files-2.1/eu.esdihumboldt.hale/eu.esdihumboldt.hale.io.xsd/2.9.5-SNAPSHOT/fe32ccb0764ec0adcfab7563b3d84e46c36bd3a0/eu.esdihumboldt.hale.io.xsd-2.9.5-SNAPSHOT.jar!/schemas/xml.xsd";
    HumboldtURIResolver resolver = new HumboldtURIResolver();
    InputSource source = resolver.resolveEntity("ns", location, baseUri);
    assertEquals(expected, source.getSystemId());
}
Also used : InputSource(org.xml.sax.InputSource) HumboldtURIResolver(eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver) Test(org.junit.Test)

Example 3 with HumboldtURIResolver

use of eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver in project hale by halestudio.

the class HumboldtURIResolverTest method testHttpAbsoluteOtherHttp.

@SuppressWarnings("javadoc")
@Test
public void testHttpAbsoluteOtherHttp() {
    String baseUri = "file:///C:/Test/gml/3.2.1/feature.xsd";
    String location = "http://schemas.opengis.net/gml/3.2.1/gml.xsd";
    String expected = location;
    HumboldtURIResolver resolver = new HumboldtURIResolver();
    InputSource source = resolver.resolveEntity("ns", location, baseUri);
    assertEquals(expected, source.getSystemId());
}
Also used : InputSource(org.xml.sax.InputSource) HumboldtURIResolver(eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver) Test(org.junit.Test)

Example 4 with HumboldtURIResolver

use of eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver in project hale by halestudio.

the class HumboldtURIResolverTest method testHttpAbsolute1.

@SuppressWarnings("javadoc")
@Test
public void testHttpAbsolute1() {
    String baseUri = "http://schemas.opengis.net/gml/3.2.1/gml.xsd";
    String location = "http://schemas.opengis.net/gml/3.2.1/feature.xsd";
    String expected = location;
    HumboldtURIResolver resolver = new HumboldtURIResolver();
    InputSource source = resolver.resolveEntity("ns", location, baseUri);
    assertEquals(expected, source.getSystemId());
}
Also used : InputSource(org.xml.sax.InputSource) HumboldtURIResolver(eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver) Test(org.junit.Test)

Example 5 with HumboldtURIResolver

use of eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver in project hale by halestudio.

the class HumboldtURIResolverTest method testHttpAbsoluteOtherJar.

@SuppressWarnings("javadoc")
@Test
public void testHttpAbsoluteOtherJar() {
    String baseUri = "http://schemas.opengis.net/gml/3.2.1/gml.xsd";
    String location = "jar:file:/home/simon/.gradle/caches/modules-2/files-2.1/eu.esdihumboldt.hale/eu.esdihumboldt.hale.io.xsd/2.9.5-SNAPSHOT/fe32ccb0764ec0adcfab7563b3d84e46c36bd3a0/eu.esdihumboldt.hale.io.xsd-2.9.5-SNAPSHOT.jar!/schemas/xml.xsd";
    String expected = location;
    HumboldtURIResolver resolver = new HumboldtURIResolver();
    InputSource source = resolver.resolveEntity("ns", location, baseUri);
    assertEquals(expected, source.getSystemId());
}
Also used : InputSource(org.xml.sax.InputSource) HumboldtURIResolver(eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver) Test(org.junit.Test)

Aggregations

HumboldtURIResolver (eu.esdihumboldt.hale.io.xsd.reader.internal.HumboldtURIResolver)9 Test (org.junit.Test)8 InputSource (org.xml.sax.InputSource)8 IOProviderConfigurationException (eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException)1 XmlIndex (eu.esdihumboldt.hale.io.xsd.model.XmlIndex)1 ProgressURIResolver (eu.esdihumboldt.hale.io.xsd.reader.internal.ProgressURIResolver)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 HashSet (java.util.HashSet)1 StreamSource (javax.xml.transform.stream.StreamSource)1 XmlSchema (org.apache.ws.commons.schema.XmlSchema)1 XmlSchemaCollection (org.apache.ws.commons.schema.XmlSchemaCollection)1 XmlSchemaImport (org.apache.ws.commons.schema.XmlSchemaImport)1