@Test public void cache() throws Exception { File cacheDirectory = new File( URLs.urlToFile( AppSchemaConfigurationTest.class.getResource("/test-data/cache")), "../cache"); SchemaResolver resolver = new SchemaResolver(new SchemaCache(cacheDirectory, false)); Configuration configuration = new AppSchemaConfiguration( "http: "http: resolver); SchemaIndex schemaIndex = null; try { schemaIndex = Schemas.findSchemas(configuration); Assert.assertEquals(3, schemaIndex.getSchemas().length); String schemaLocation = null; for (XSDSchema schema : schemaIndex.getSchemas()) { if (schema.getSchemaLocation().endsWith("cache-test.xsd")) { schemaLocation = schema.getSchemaLocation(); break; } } Assert.assertNotNull(schemaLocation); Assert.assertTrue(schemaLocation.startsWith("file:")); Assert.assertTrue(URLs.urlToFile(new URL(schemaLocation)).exists()); Assert.assertNotNull( schemaIndex.getElementDeclaration( new QName("http: Assert.assertFalse( cacheDirectory.toString().equals(cacheDirectory.getCanonicalFile().toString())); Assert.assertNotNull( schemaIndex.getElementDeclaration( new QName("http: } finally { if (schemaIndex != null) { schemaIndex.destroy(); } } }
public String getSchemaLocation() { return originalSchemaLocation; }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } AppSchemaConfiguration(
            String namespace, String schemaLocation, SchemaResolver resolver); }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } AppSchemaConfiguration(
            String namespace, String schemaLocation, SchemaResolver resolver); String getSchemaLocation(); @Override void addDependency(Configuration dependency); }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } AppSchemaConfiguration(
            String namespace, String schemaLocation, SchemaResolver resolver); String getSchemaLocation(); @Override void addDependency(Configuration dependency);  }