Package org.geotools.data.property.ng

Examples of org.geotools.data.property.ng.PropertyFeatureWriter


        assertEquals( 5, count( "road" ));                   
    }
    public void testWriterChangeIgnoreAppend() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        SimpleFeature f;
        writer.next();
        writer.next();
        writer.next();
        writer.next();
        writer.next();
        assertFalse( writer.hasNext() );
        f = writer.next();
        assertNotNull( f );
        f.setAttribute(0,new Integer(-1));       
        f.setAttribute(1,"new");       
        writer.close();
        assertEquals( 5, count( "road" ));                   
    }
View Full Code Here


    }
   
    public void testWriterSkipThrough() throws Exception {
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        File in = writer.read;
        File out = writer.write;
       
        int count = 0;
        while( writer.hasNext() ){
            writer.next();
            count++;
        }
        assertEquals( 5, count );
        assertTrue( in.exists() );
        assertTrue( out.exists() );
        writer.close();
        assertTrue( in.exists() );       
       
        assertEquals( 5, count( "road" ) );
    }
View Full Code Here

        assertEquals( 5, count( "road" ) );
    }
    public void testWriterChangeName() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        int count = 0;
        while( writer.hasNext() ){
            SimpleFeature f = writer.next();
            f.setAttribute(1,"name "+(count+1));
            writer.write();
            count++;
        }               
        writer.close();       
        assertEquals( 5, count );
        assertEquals( 5, count( "road" ));               
    }
View Full Code Here

        assertEquals( 5, count( "road" ));               
    }
    public void testWriterChangeFirstName() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        SimpleFeature f;
        f = writer.next();
        f.setAttribute(1,"changed");
        writer.write();
        writer.close();                          
        assertEquals( 5, count( "road" ));   
    }
View Full Code Here

        assertEquals( 5, count( "road" ));   
    }
    public void testWriterChangeLastName() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        SimpleFeature f;
        writer.next();
        writer.next();
        writer.next();       
        f = writer.next();
        f.setAttribute(1,"changed");
        writer.write();
        writer.close();                          
        assertEquals( 5, count( "road" ));   
    }   
View Full Code Here

        assertEquals( 5, count( "road" ));   
    }   
    public void testWriterChangeAppend() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        SimpleFeature f;
        writer.next();
        writer.next();
        writer.next();
        writer.next();
        writer.next();
        assertFalse( writer.hasNext() );
        f = writer.next();
        assertNotNull( f );
        f.setAttribute(0,new Integer(-1));       
        f.setAttribute(1,"new");
        writer.write();
        writer.close();
        assertEquals( 6, count( "road" ));   
    }
View Full Code Here

        assertEquals( 6, count( "road" ));   
    }
    public void testWriterChangeRemoveFirst() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
       
        writer.next();
        writer.remove();
        writer.close();
        assertEquals( 4, count( "road" ));   
    }
View Full Code Here

        assertEquals( 4, count( "road" ));   
    }
    public void testWriterChangeRemoveLast() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
       
        writer.next();
        writer.next();
        writer.next();
        writer.remove();
        writer.close();
        assertEquals( 4, count( "road" ));   
    }
View Full Code Here

        assertEquals( 4, count( "road" ));   
    }
    public void testWriterChangeRemoveAppend() throws Exception{
        Query query = new Query("road");
        PropertyFeatureStore featureStore = (PropertyFeatureStore) store.getFeatureSource("road");
        PropertyFeatureWriter writer = (PropertyFeatureWriter) featureStore.getWriterInternal( query, 0x01<<0 );
       
        SimpleFeature f;
        writer.next();
        writer.next();
        writer.next();
        writer.next();       
        writer.next();       
               
        assertFalse( writer.hasNext() );
        f = writer.next();
        assertNotNull( f );
        f.setAttribute(0,new Integer(-1));       
        f.setAttribute(1,"new");
        writer.remove();
        writer.close();
        assertEquals( 5, count( "road" ));                   
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.property.ng.PropertyFeatureWriter

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.