Package it.geosolutions.geoserver.rest.encoder.datastore

Examples of it.geosolutions.geoserver.rest.encoder.datastore.GSDirectoryOfShapefilesDatastoreEncoder


        LOCATION_2 = new URL("file:data/2");
    }

    @Override
    public GSAbstractStoreEncoder getStoreEncoderTest() {
        return new GSDirectoryOfShapefilesDatastoreEncoder(DS_NAME, LOCATION_1);
    }
View Full Code Here


        // Create workspace
        assertTrue(publisher.createWorkspace(WS_NAME));

        // Create a directory of spatial files with default parameters
        GSDirectoryOfShapefilesDatastoreEncoder create = new GSDirectoryOfShapefilesDatastoreEncoder(
                DS_NAME, LOCATION_1);
        assertTrue(manager.getStoreManager().create(WS_NAME, create));

        // Read the store from server; check all parameter values
        RESTDataStore read = reader.getDatastore(WS_NAME, DS_NAME);
        assertEquals(read.getName(), DS_NAME);
        assertEquals(read.getWorkspaceName(), WS_NAME);
        assertEquals(read.isEnabled(), true);

        Map<String, String> connParams = read.getConnectionParameters();
        assertEquals(connParams.get("url"), LOCATION_1.toString());
        assertEquals(connParams.get("charset"), "ISO-8859-1");
        assertEquals(connParams.get("create spatial index"), "true");
        assertEquals(connParams.get("memory mapped buffer"), "false");
        assertEquals(connParams.get("cache and reuse memory maps"), "true");

        // Change all parameter to non-default values
        GSDirectoryOfShapefilesDatastoreEncoder update = new GSDirectoryOfShapefilesDatastoreEncoder(
                read);
        update.setDescription(DS_DESCRIPTION);
        update.setEnabled(false);
        update.setUrl(LOCATION_2);
        update.setCharset(Charset.forName("UTF-8"));
        update.setCreateSpatialIndex(false);
        update.setMemoryMappedBuffer(true);
        update.setCacheAndReuseMemoryMaps(false);

        // update the store
        assertTrue(manager.getStoreManager().update(WS_NAME, update));

        // Read again, check that all parameters have changed
View Full Code Here

TOP

Related Classes of it.geosolutions.geoserver.rest.encoder.datastore.GSDirectoryOfShapefilesDatastoreEncoder

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.