SchemaResolver { public static String getSimpleHttpResourcePath(String location) { return getSimpleHttpResourcePath(location, false); } SchemaResolver(SchemaCatalog catalog, boolean classpath, SchemaCache cache);  SchemaResolver(SchemaCatalog catalog, SchemaCache cache);  SchemaResolver();  SchemaResolver(SchemaCatalog catalog);  SchemaResolver(SchemaCache cache); String resolve(String location, String context); String resolve(String location); static String getSimpleHttpResourcePath(String location); static String getSimpleHttpResourcePath(String location, boolean keepQuery); static String getSimpleHttpResourcePath(URI location); static String getSimpleHttpResourcePath(URI location, boolean keepQuery); static URL getClasspathResourceUrl(String location); static String resolveClasspathLocation(String location);  }
@Test public void geosciml20() { String path = SchemaResolver .getSimpleHttpResourcePath("http: Assert.assertEquals(path, "/org/geosciml/www/geosciml/2.0/xsd/geosciml.xsd"); String classpathPath = SchemaResolver.class.getResource(path).toExternalForm(); Assert.assertTrue(classpathPath.startsWith("jar:file:/")); Assert.assertTrue(classpathPath .endsWith("!/org/geosciml/www/geosciml/2.0/xsd/geosciml.xsd")); }
@Test public void exampleHttp() { String path = SchemaResolver .getSimpleHttpResourcePath("http: Assert.assertEquals("/org/example/schemas/exampleml/exml.xsd", path); }
@Test public void exampleHttps() { String path = SchemaResolver .getSimpleHttpResourcePath("https: Assert.assertEquals("/org/example/schemas/exampleml/exml.xsd", path); }
@Test public void portIgnored() { String path = SchemaResolver .getSimpleHttpResourcePath("http: Assert.assertEquals("/org/example/schemas/exampleml/exml.xsd", path); }
@Test public void queryIgnored() { String path = SchemaResolver .getSimpleHttpResourcePath("http: Assert.assertEquals("/org/example/schemas/exampleml/exml.xsd", path); }
@Test public void getSimpleHttpResourcePath_KeepQueryTrue_ReturnPathHasQueryComponent() { String path = SchemaResolver .getSimpleHttpResourcePath( "http: true); Assert.assertEquals("/org/example/schemas/wfs.0dd5330a4f06ea193985897a2cfd65d3.xsd", path); }
@Test public void ftpReturnsNull() { Assert.assertNull(SchemaResolver .getSimpleHttpResourcePath("ftp: }
@Test public void jarReturnsNull() { Assert.assertNull(SchemaResolver .getSimpleHttpResourcePath("jar:file:example.jar!/org/example/schemas/exampleml/exml.xsd")); }
@Test public void badlyFormattedUrlReturnsNull() { Assert.assertNull(SchemaResolver .getSimpleHttpResourcePath("http: }