Permalink
Browse files

Similar story for wfs-ng fixing of test cases required

  • Loading branch information...
jodygarnett committed Oct 30, 2012
1 parent cf3f4b9 commit 6c0fe5ed911b82466718019536e0b49c64ffdb1e
@@ -182,15 +182,11 @@ protected void dataSetUp() throws Exception {
protected abstract String getRiverTypeName();
SimpleFeature[] grabArray(SimpleFeatureCollection features, int size) {
- try {
- SimpleFeature array[] = new SimpleFeature[size];
- array = (SimpleFeature[]) features.toArray(array);
- assertNotNull(array);
+ SimpleFeature array[] = new SimpleFeature[size];
+ array = (SimpleFeature[]) features.toArray(array);
+ assertNotNull(array);
- return array;
- } finally {
- features.purge();
- }
+ return array;
}
protected void tearDown() throws Exception {
@@ -189,17 +189,15 @@ private void testTypes(DataStore wfs) throws IOException, NoSuchElementException
Query query = new Query(typeName, Filter.INCLUDE, 20, Query.ALL_NAMES, "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 = iterator.next();
+ }
+ } finally {
+ iterator.close();
}
- features.close(iterator);
}
}
@@ -234,18 +232,14 @@ private void testSingleType(DataStore wfs) throws IOException, NoSuchElementExce
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();
+ try {
+ while (iterator.hasNext()) {
+ SimpleFeature feature = iterator.next();
+ }
+ } finally {
+ iterator.close();
}
- features.close(iterator);
}
// public void XtestFeatureType() throws NoSuchElementException, IOException, SAXException {

0 comments on commit 6c0fe5e

Please sign in to comment.