use of com.sldeditor.datasource.impl.CreateSampleData in project sldeditor by robward-scisys.
the class CreateSampleDataTest method testGetDataStore.
/**
* Test method for {@link com.sldeditor.datasource.impl.CreateSampleData#getDataStore()}.
*/
@Test
public void testGetDataStore() {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
String typeName = "test type name";
b.setName(typeName);
String namespace = null;
b.setNamespaceURI(namespace);
// add a geometry property
// set crs first
b.setCRS(DefaultGeographicCRS.WGS84);
b.add("the_geom", Polygon.class);
b.setDefaultGeometry("the_geom");
// Build the feature type
SimpleFeatureType schema = b.buildFeatureType();
CreateSampleData sampleData = new CreateSampleData();
sampleData.create(null, null);
sampleData.create(schema, null);
DataStore dataStore = sampleData.getDataStore();
assertTrue(dataStore != null);
assertEquals(GeometryTypeEnum.POLYGON, sampleData.getGeometryType());
}
Aggregations