use of org.geotools.data.simple.SimpleFeatureCollection in project GeoGig by boundlessgeo.
the class GeoGigFeatureSourceTest method testGetFeatures.
@Test
public void testGetFeatures() throws Exception {
SimpleFeatureCollection collection;
Set<List<Object>> actual;
Set<List<Object>> expected;
collection = pointsSource.getFeatures();
assertEquals(pointsType, collection.getSchema());
actual = Sets.newHashSet();
for (Feature f : toList(collection)) {
SimpleFeature sf = (SimpleFeature) f;
actual.add(sf.getAttributes());
}
expected = ImmutableSet.of(((SimpleFeature) points1).getAttributes(), ((SimpleFeature) points2).getAttributes(), ((SimpleFeature) points3).getAttributes());
assertEquals(expected, actual);
collection = linesSource.getFeatures();
assertEquals(linesType, collection.getSchema());
actual = Sets.newHashSet();
for (Feature f : toList(collection)) {
actual.add(((SimpleFeature) f).getAttributes());
}
expected = ImmutableSet.of(((SimpleFeature) lines1).getAttributes(), ((SimpleFeature) lines2).getAttributes(), ((SimpleFeature) lines3).getAttributes());
assertEquals(expected, actual);
}
Aggregations