@Test public void cache() throws Exception { File cacheDirectory = new File(DataUtilities.urlToFile(AppSchemaConfigurationTest.class .getResource("/test-data/cache")), "../cache"); AppSchemaResolver resolver = new AppSchemaResolver( new AppSchemaCache(cacheDirectory, false)); Configuration configuration = new AppSchemaConfiguration( "http: "http: 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(DataUtilities.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,
            AppSchemaResolver resolver); }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } AppSchemaConfiguration(String namespace, String schemaLocation,
            AppSchemaResolver resolver); String getSchemaLocation(); @Override void addDependency(Configuration dependency); }
AppSchemaConfiguration extends Configuration { public String getSchemaLocation() { return originalSchemaLocation; } AppSchemaConfiguration(String namespace, String schemaLocation,
            AppSchemaResolver resolver); String getSchemaLocation(); @Override void addDependency(Configuration dependency);  }