Examples of CSVFileState


Examples of org.geoserver.importer.csv.CSVFileState

public class CSVSpecifiedLatLngStrategyTest {

    @Test
    public void testBuildFeatureType() {
        String input = CSVTestStrategySupport.buildInputString("quux,morx\n");
        CSVFileState fileState = new CSVFileState(input, "foo");
        CSVStrategy strategy = new CSVSpecifiedLatLngStrategy(fileState, "quux", "morx");
        SimpleFeatureType featureType = strategy.getFeatureType();

        assertEquals("Invalid attribute count", 1, featureType.getAttributeCount());
        assertEquals("Invalid featuretype name", "foo", featureType.getName().getLocalPart());
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    @Test
    public void testCreateFeature() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("fleem,zoo,morx", "3,4,car",
                "8,9.9,cdr");
        CSVFileState fileState = new CSVFileState(input, "bar");
        CSVStrategy strategy = new CSVSpecifiedLatLngStrategy(fileState, "fleem", "zoo");

        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 2, featureType.getAttributeCount());
        List<AttributeDescriptor> attrs = featureType.getAttributeDescriptors();
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    }

    @Test
    public void testCreateSpecifiedLatLngColumnsDontExist() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("blub", "fubar");
        CSVFileState fileState = new CSVFileState(input, "zul");
        CSVStrategy strategy = new CSVSpecifiedLatLngStrategy(fileState, "non", "existing");
        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 1, featureType.getAttributeCount());
        CSVIterator iterator = strategy.iterator();
        assertTrue("next value not read", iterator.hasNext());
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    }

    @Test
    public void testCreateSpecifiedLatLngColumnsNotNumeric() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("foo,bar", "3.8,quux");
        CSVFileState fileState = new CSVFileState(input, "zul");
        CSVStrategy strategy = new CSVSpecifiedLatLngStrategy(fileState, "foo", "bar");
        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 2, featureType.getAttributeCount());
        CSVIterator iterator = strategy.iterator();
        assertTrue("next value not read", iterator.hasNext());
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

public class CSVAttributesOnlyStrategyTest {

    @Test
    public void testBuildFeatureType() {
        String input = CSVTestStrategySupport.buildInputString("quux,morx\n");
        CSVFileState fileState = new CSVFileState(input, "foo");
        CSVStrategy strategy = new CSVAttributesOnlyStrategy(fileState);
        SimpleFeatureType featureType = strategy.getFeatureType();

        assertEquals("Invalid attribute count", 2, featureType.getAttributeCount());
        assertEquals("Invalid featuretype name", "foo", featureType.getName().getLocalPart());
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    @Test
    public void testCreateFeature() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("fleem,zoo,morx", "3,4,car",
                "8,9.9,cdr");
        CSVFileState fileState = new CSVFileState(input, "bar");
        CSVStrategy strategy = new CSVAttributesOnlyStrategy(fileState);

        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 3, featureType.getAttributeCount());
        List<AttributeDescriptor> attrs = featureType.getAttributeDescriptors();
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    }

    @Test
    public void testCreateNoGeometry() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("blub", "fubar");
        CSVFileState fileState = new CSVFileState(input, "zul");
        CSVStrategy strategy = new CSVAttributesOnlyStrategy(fileState);
        CSVIterator iterator = strategy.iterator();
        assertTrue("next value not read", iterator.hasNext());
        SimpleFeature feature = iterator.next();
        Object defaultGeometry = feature.getDefaultGeometry();
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

public class CSVSpecifiedWKTStrategyTest {

    @Test
    public void testBuildFeatureType() {
        String input = CSVTestStrategySupport.buildInputString("quux,morx\n");
        CSVFileState fileState = new CSVFileState(input, "foo");
        CSVStrategy strategy = new CSVSpecifiedWKTStrategy(fileState, "quux");
        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 2, featureType.getAttributeCount());
        GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
        assertEquals("Invalid geometry attribute name", "quux", geometryDescriptor.getLocalName());
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

    @Test
    public void testCreateFeature() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("fleem,zoo,morx",
                "foo,POINT(3.14 1.59),car");
        CSVFileState fileState = new CSVFileState(input, "bar");
        CSVStrategy strategy = new CSVSpecifiedWKTStrategy(fileState, "zoo");
        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 3, featureType.getAttributeCount());
        CSVTestStrategySupport.verifyType(featureType.getDescriptor("fleem"), String.class);
        CSVTestStrategySupport.verifyType(featureType.getDescriptor("zoo"), Geometry.class);
View Full Code Here

Examples of org.geoserver.importer.csv.CSVFileState

        assertEquals("Invalid y coordinate", coordinate.y, 1.59, 0.1);
    }

    public void testCreateFeatureBadGeometry() throws IOException {
        String input = CSVTestStrategySupport.buildInputString("fleem,morx", "foo,bar");
        CSVFileState fileState = new CSVFileState(input, "blub");
        CSVStrategy strategy = new CSVSpecifiedWKTStrategy(fileState, "fleem");
        SimpleFeatureType featureType = strategy.getFeatureType();
        assertEquals("Invalid attribute count", 2, featureType.getAttributeCount());
        CSVTestStrategySupport.verifyType(featureType.getDescriptor("fleem"), Geometry.class);
        CSVTestStrategySupport.verifyType(featureType.getDescriptor("morx"), String.class);
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.