boolean covers(SimpleFeatureIterator reader, SimpleFeature[] array) throws NoSuchElementException, IOException { SimpleFeature feature; int count = 0; try { while (reader.hasNext()) { feature = reader.next(); if (!contains(array, feature)) { return false; } count++; } } finally { reader.close(); } return count == array.length; }
/** * Ensure that FeatureReader<SimpleFeatureType, SimpleFeature> reader contains extactly the * contents of array. * * @param reader DOCUMENT ME! * @param array DOCUMENT ME! * @return DOCUMENT ME! * @throws NoSuchElementException DOCUMENT ME! * @throws IOException DOCUMENT ME! * @throws IllegalAttributeException DOCUMENT ME! */ boolean covers(FeatureReader<SimpleFeatureType, SimpleFeature> reader, SimpleFeature[] array) throws NoSuchElementException, IOException { SimpleFeature feature; int count = 0; try { while (reader.hasNext()) { feature = reader.next(); if (!contains(array, feature)) { return false; } count++; } } finally { reader.close(); } return count == array.length; }
void assertCovered( SimpleFeature[] features, FeatureReader<SimpleFeatureType, SimpleFeature> reader) throws NoSuchElementException, IOException { int count = 0; try { while (reader.hasNext()) { assertTrue(contains(features, reader.next())); count++; } } finally { reader.close(); } assertEquals(features.length, count); }