Package org.geotools.xml.resolver

Examples of org.geotools.xml.resolver.SchemaResolver


     */
    @Test
    public void catalog() throws Exception {
        Configuration configuration = new AppSchemaConfiguration(
                "http://schemas.example.org/catalog-test",
                "http://schemas.example.org/catalog-test/catalog-test.xsd", new SchemaResolver(
                        SchemaCatalog.build(getClass().getResource("/test-data/catalog.xml"))));
        SchemaIndex schemaIndex = null;
        try {
            schemaIndex = Schemas.findSchemas(configuration);
            Assert.assertEquals(3, schemaIndex.getSchemas().length);
View Full Code Here


     * Test we can {@link Schemas#findSchemas(Configuration)} with classpath only.
     */
    @Test
    public void classpath() {
        Configuration configuration = new AppSchemaConfiguration("urn:cgi:xmlns:CGI:GeoSciML:2.0",
                "http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd", new SchemaResolver());
        SchemaIndex schemaIndex = null;
        try {
            schemaIndex = Schemas.findSchemas(configuration);
            Assert.assertEquals(3, schemaIndex.getSchemas().length);
            String schemaLocation = null;
View Full Code Here

    @Test
    public void cache() throws Exception {
        // intentionally use a non-canonical cache path to ensure these handled correctly
        File cacheDirectory = new File(DataUtilities.urlToFile(AppSchemaConfigurationTest.class
                .getResource("/test-data/cache")), "../cache");
        SchemaResolver resolver = new SchemaResolver(
                new SchemaCache(cacheDirectory, false));
        Configuration configuration = new AppSchemaConfiguration(
                "http://schemas.example.org/cache-test",
                "http://schemas.example.org/cache-test/cache-test.xsd", resolver);
        SchemaIndex schemaIndex = null;
View Full Code Here

     */
    @Test
    public void catalogCache() throws Exception {
        File cacheDirectory = DataUtilities.urlToFile(AppSchemaConfigurationTest.class
                .getResource("/test-data/cache"));
        SchemaResolver resolver = new SchemaResolver(SchemaCatalog.build(getClass()
                .getResource("/test-data/catalog.xml")), new SchemaCache(cacheDirectory, false));
        Configuration configuration = new AppSchemaConfiguration(
                "http://schemas.example.org/catalog-test",
                "http://schemas.example.org/catalog-test/catalog-cache-test.xsd", resolver);
        SchemaIndex schemaIndex = null;
View Full Code Here

     * Test we can resolve GML 3.2 schema on the classpath.
     */
    @Test
    public void classpathGml32() {
        Configuration configuration = new AppSchemaConfiguration("http://www.opengis.net/gml/3.2",
                "http://schemas.opengis.net/gml/3.2.1/gml.xsd", new SchemaResolver());
        SchemaIndex schemaIndex = null;
        try {
            schemaIndex = Schemas.findSchemas(configuration);
            Assert.assertNotNull(schemaIndex.getElementDeclaration(new QName(
                    "http://www.opengis.net/gml/3.2", "AbstractFeature")));
View Full Code Here

                cacheDir = tempFolder;
            } else {
                cacheDir = new File(System.getProperty("schema.factory.cache"));
            }
           
            resolver = new SchemaResolver(new SchemaCache(cacheDir, true));
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.resolver.SchemaResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.