Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix up a test case to use FeatureIterator.close()

  • Loading branch information...
commit cf3f4b9de80dc284cedd0634fc8938740d03f146 1 parent bb8bf56
@jodygarnett jodygarnett authored
View
25 modules/unsupported/wfs/src/test/java/org/geotools/data/wfs/v1_0_0/GeoServerOnlineTest.java
@@ -161,17 +161,15 @@ public void testTypes() throws IOException, NoSuchElementException {
"work already");
features = source.getFeatures(query);
features.size();
- Iterator reader = features.iterator();
- while (reader.hasNext()) {
- SimpleFeature feature = (SimpleFeature) reader.next();
- }
- features.close(reader);
-
SimpleFeatureIterator iterator = features.features();
- while (iterator.hasNext()) {
- SimpleFeature feature = iterator.next();
+ try {
+ while (iterator.hasNext()) {
+ SimpleFeature feature = (SimpleFeature) iterator.next();
+ }
+ }
+ finally {
+ iterator.close();
}
- features.close(iterator);
}
}
@@ -210,18 +208,11 @@ public void testSingleType() throws IOException, NoSuchElementException {
features = source.getFeatures(query);
features.size();
- Iterator reader = features.iterator();
- while (reader.hasNext()) {
- SimpleFeature feature = (SimpleFeature) reader.next();
- System.out.println(feature);
- }
- features.close(reader);
-
SimpleFeatureIterator iterator = features.features();
while (iterator.hasNext()) {
SimpleFeature feature = iterator.next();
}
- features.close(iterator);
+ iterator.close();
}
public void XtestFeatureType() throws NoSuchElementException, IOException, SAXException {

0 comments on commit cf3f4b9

Please sign in to comment.
Something went wrong with that request. Please try again.