Examples of removeFeatures()


Examples of org.geotools.data.FeatureStore.removeFeatures()

                throw e;
            }
           
            //delete all features
            FeatureStore store = (FeatureStore) dataStore.getFeatureSource( schema.getName() );
            store.removeFeatures(Filter.INCLUDE);
        }
       
        return dataStore.getFeatureWriterAppend( schema.getTypeName(), Transaction.AUTO_COMMIT );
    }
   
View Full Code Here

Examples of org.geotools.data.FeatureStore.removeFeatures()

    public void testFullAccess() throws Exception {
        FeatureSource source = getFeatureSource(MockData.LINES);
        FeatureCollection fc = source.getFeatures();
        FeatureStore store = (FeatureStore) source;
        store.removeFeatures(Filter.INCLUDE);
    }

    public void testCannotRead() throws Exception {
        try {
            getFeatureSource(MockData.BUILDINGS);
View Full Code Here

Examples of org.geotools.data.FeatureStore.removeFeatures()

    public void testCannotWrite() throws Exception {
        FeatureStore fs = (FeatureStore) getFeatureSource(MockData.DELETES);
               
        try {
            fs.removeFeatures(Filter.INCLUDE);
            fail("This should have failed with a security exception!");
        } catch (AcegiSecurityException e) {
            // fine, we should not be able to get to the feature source
        }
    }
View Full Code Here

Examples of org.geotools.data.FeatureStore.removeFeatures()

    public void testFullAccess() throws Exception {
        FeatureSource source = getFeatureSource(MockData.LINES);
        FeatureCollection fc = source.getFeatures();
        FeatureStore store = (FeatureStore) source;
        store.removeFeatures(Filter.INCLUDE);
    }

    public void testCannotRead() throws Exception {
        try {
            getFeatureSource(MockData.BUILDINGS);
View Full Code Here

Examples of org.geotools.data.FeatureStore.removeFeatures()

    public void testCannotWrite() throws Exception {
        FeatureStore fs = (FeatureStore) getFeatureSource(MockData.DELETES);
               
        try {
            fs.removeFeatures(Filter.INCLUDE);
            fail("This should have failed with a security exception!");
        } catch (SpringSecurityException e) {
            // fine, we should not be able to get to the feature source
        }
    }
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

    protected void setUp() throws Exception {
        super.setUp();
       
        // create a feature store
        VersioningFeatureStore mockStore = createNiceMock(VersioningFeatureStore.class);
        mockStore.removeFeatures(Filter.INCLUDE);
        expect(mockStore.getSchema()).andReturn(DataUtilities.createType(SCHEMA, "id:int"));
        replay(mockStore);

        // create a data store
        mock = createNiceMock(VersioningDataStore.class);
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // make the same changes as in the post diff
        Id updateFilter = ff.id(singleton(ff.featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        // remove the third feature
        Id removeFilter = ff.id(singleton(ff.featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        restricted.removeFeatures(removeFilter);
        assertEquals(3, restricted.getCount(Query.ALL));
       

        // get the response and do the basic checks
        MockHttpServletResponse response = postAsServletResponse(root(true),
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

    }

    public void testDeleteConflict() throws Exception {
        // grab the datastore so that we can make some changes that will generate conflicts
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        restricted.removeFeatures(ff.id(singleton(ff.featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4"))));
        assertEquals(3, restricted.getCount(Query.ALL));
    
        // get the response and do the basic checks
        MockHttpServletResponse response = postAsServletResponse(root(true),
                loadTextResource("PostDiffInitial.xml"));
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

                .featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        // a delete
        Id removeFilter = ff.id(singleton(ff
                .featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        restricted.removeFeatures(removeFilter);
        // and an insert
        WKTReader wkt = new WKTReader();
        SimpleFeature f = SimpleFeatureBuilder.build(schema, new Object[] { 123,
                wkt.read("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))") }, null);
        restricted.addFeatures(collection(f));
View Full Code Here

Examples of org.geotools.data.VersioningFeatureStore.removeFeatures()

        // apply a local change on Central so that we'll get a non empty transaction sent to the client
        VersioningFeatureStore restricted = (VersioningFeatureStore) synchStore.getFeatureSource("restricted");
        SimpleFeatureType schema = restricted.getSchema();
        // remove the third feature
        Id removeFilter = ff.id(singleton(ff.featureId("restricted.c15e76ab-e44b-423e-8f85-f6d9927b878a")));
        restricted.removeFeatures(removeFilter);
        assertEquals(3, restricted.getCount(Query.ALL));
       
        // build the expected PostDiff request
        QName typeName = new QName("http://www.openplans.org/spearfish", "restricted");
        PostDiffType postDiff = new PostDiffType();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.