Permalink
Browse files

Fix up shapefile-ng test cases to use DefaultFeatureCollection to sta…

…ge data
  • Loading branch information...
1 parent 88656ef commit e89e9a7feaca1fb4219a613d09423d256692188b @jodygarnett jodygarnett committed Oct 30, 2012
@@ -58,7 +58,7 @@
import org.geotools.data.simple.SimpleFeatureStore;
import org.geotools.factory.CommonFactoryFinder;
import org.geotools.factory.FactoryRegistryException;
-import org.geotools.feature.FeatureCollections;
+import org.geotools.feature.DefaultFeatureCollection;
import org.geotools.feature.FeatureTypes;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
@@ -851,7 +851,7 @@ private SimpleFeatureCollection createFeatureCollection() throws Exception {
SimpleFeatureType featureType = createExampleSchema();
SimpleFeatureBuilder build = new SimpleFeatureBuilder(featureType);
- SimpleFeatureCollection features = FeatureCollections.newCollection();
+ DefaultFeatureCollection features = new DefaultFeatureCollection();
for (int i = 0, ii = 20; i < ii; i++) {
build.add(new GeometryFactory().createPoint(new Coordinate(1, -1)));
@@ -910,7 +910,7 @@ public void testWriteReadBigNumbers() throws Exception {
// create feature type
SimpleFeatureType type = DataUtilities.createType("junk",
"a:Point,b:java.math.BigDecimal,c:java.math.BigInteger");
- SimpleFeatureCollection features = FeatureCollections.newCollection();
+ DefaultFeatureCollection features = new DefaultFeatureCollection();
BigInteger bigInteger = new BigInteger("1234567890123456789");
BigDecimal bigDecimal = new BigDecimal(bigInteger, 2);
@@ -999,7 +999,7 @@ private void runWriteReadTest(Geometry geom, boolean d3) throws Exception {
ftb.add("a", geom.getClass());
SimpleFeatureType type = ftb.buildFeatureType();
- SimpleFeatureCollection features = FeatureCollections.newCollection();
+ DefaultFeatureCollection features = new DefaultFeatureCollection();
SimpleFeatureBuilder build = new SimpleFeatureBuilder(type);
for (int i = 0, ii = 20; i < ii; i++) {
build.set(0, (Geometry) geom.clone());
@@ -30,6 +30,7 @@
import org.geotools.data.simple.SimpleFeatureIterator;
import org.geotools.data.simple.SimpleFeatureStore;
import org.geotools.factory.CommonFactoryFinder;
+import org.geotools.feature.DefaultFeatureCollection;
import org.geotools.feature.FeatureCollections;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.opengis.feature.simple.SimpleFeature;
@@ -108,7 +109,7 @@ public void testAddFeature() throws Exception {
build.add(new Long(0));
build.add("Hey");
SimpleFeature newFeature = build.buildFeature(null);
- SimpleFeatureCollection collection = FeatureCollections.newCollection();
+ DefaultFeatureCollection collection = new DefaultFeatureCollection();
collection.add(newFeature);
List<FeatureId> newFids = featureStore.addFeatures(collection);

0 comments on commit e89e9a7

Please sign in to comment.