public boolean contains(Object o) { return delegate.contains(o); }
public boolean contains(Object o) { return delegate.contains(o) && filter.evaluate(o); }
public boolean contains(Object o) { return delegate.contains(o); }
public boolean contains(Object o) { return delegate.contains( o ) && filter.evaluate( o ); }
void assertCovers(String msg, SimpleFeatureCollection c1, SimpleFeatureCollection c2) { if (c1 == c2) { return; } assertNotNull(msg, c1); assertNotNull(msg, c2); assertEquals(msg + " size", c1.size(), c2.size()); SimpleFeature f; for (SimpleFeatureIterator i = c1.features(); i.hasNext(); ) { f = i.next(); assertTrue(msg + " " + f.getID(), c2.contains(f)); } }
@Then("^datastore \"([^\"]*)\" and datastore \"([^\"]*)\" both have the same features$") public void datastores_have_the_same_features(String store1, String store2) throws Throwable { // build a feature reader from the datastore SimpleFeatureStore featureStore1 = getFeatureStore(store1); SimpleFeatureStore featureStore2 = getFeatureStore(store2); SimpleFeatureCollection featureCollection1 = featureStore1.getFeatures(); SimpleFeatureCollection featureCollection2 = featureStore2.getFeatures(); assertEquals( String.format("Expected the same number of features in %s as in %s", store2, store1), featureCollection1.size(), featureCollection2.size()); try (SimpleFeatureIterator featureIterator1 = featureCollection1.features()) { while (featureIterator1.hasNext()) { SimpleFeature feature1 = featureIterator1.next(); assertTrue(String.format("Expected %s to contain all features from %s", store2, store1), featureCollection2.contains(feature1)); } } }
@Then("^datastore \"([^\"]*)\" and datastore \"([^\"]*)\" both have the same features$") public void datastores_have_the_same_features(String store1, String store2) throws Throwable { // build a feature reader from the datastore SimpleFeatureStore featureStore1 = getFeatureStore(store1); SimpleFeatureStore featureStore2 = getFeatureStore(store2); SimpleFeatureCollection featureCollection1 = featureStore1.getFeatures(); SimpleFeatureCollection featureCollection2 = featureStore2.getFeatures(); assertEquals( String.format("Expected the same number of features in %s as in %s", store2, store1), featureCollection1.size(), featureCollection2.size()); try (SimpleFeatureIterator featureIterator1 = featureCollection1.features()) { while (featureIterator1.hasNext()) { SimpleFeature feature1 = featureIterator1.next(); assertTrue(String.format("Expected %s to contain all features from %s", store2, store1), featureCollection2.contains(feature1)); } } }
@When("^I make the same edit to \"([^\"]*)\"$") public void i_make_the_same_edit(String storeName) throws Throwable { SimpleFeatureStore featureStore = getFeatureStore(storeName); SimpleFeatureCollection featureCollection = featureStore.getFeatures(); assertTrue("Expected DataStore " + storeName + " to contain feature: " + preEditedFeature, featureCollection.contains(preEditedFeature)); Transaction tx = new DefaultTransaction(); featureStore.setTransaction(tx); try { featureStore.addFeatures(DataUtilities.collection(postEditedFeature)); tx.commit(); } finally { tx.close(); } }
@When("^I make the same edit to \"([^\"]*)\"$") public void i_make_the_same_edit(String storeName) throws Throwable { SimpleFeatureStore featureStore = getFeatureStore(storeName); SimpleFeatureCollection featureCollection = featureStore.getFeatures(); assertTrue("Expected DataStore " + storeName + " to contain feature: " + preEditedFeature, featureCollection.contains(preEditedFeature)); Transaction tx = new DefaultTransaction(); featureStore.setTransaction(tx); try { featureStore.addFeatures(DataUtilities.collection(postEditedFeature)); tx.commit(); } finally { tx.close(); } }