TransformFeatureSource implements SimpleFeatureSource { @Override public ReferencedEnvelope getBounds() throws IOException { return getBounds(Query.ALL); } TransformFeatureSource(SimpleFeatureSource source, Name name, List<Definition> definitions); @Override Name getName(); @Override ResourceInfo getInfo(); @Override DataAccess<SimpleFeatureType, SimpleFeature> getDataStore(); @Override QueryCapabilities getQueryCapabilities(); @Override void addFeatureListener(FeatureListener listener); @Override void removeFeatureListener(FeatureListener listener); @Override SimpleFeatureType getSchema(); @Override ReferencedEnvelope getBounds(); @Override ReferencedEnvelope getBounds(Query query); @Override int getCount(Query query); @Override Set<Key> getSupportedHints(); @Override SimpleFeatureCollection getFeatures(); @Override SimpleFeatureCollection getFeatures(Filter filter); @Override SimpleFeatureCollection getFeatures(Query query);  }
@Test public void testBoundsWithSelect() throws Exception { SimpleFeatureSource transformed = transformWithSelection(); ReferencedEnvelope re = transformed.getBounds(); ReferencedEnvelope ae = STATES.getBounds(); assertEquals(re, ae); }
@Test public void testBoundsWithSelectNoGeom() throws Exception { SimpleFeatureSource transformed = transformWithSelection(); ReferencedEnvelope re = transformed.getBounds(new Query("states_mini", Filter.INCLUDE, new String[] { "state_name" })); assertNull(re); }
@Test public void testBoundsWithRename() throws Exception { SimpleFeatureSource transformed = transformWithRename(); ReferencedEnvelope re = transformed.getBounds(); ReferencedEnvelope ae = STATES.getBounds(); assertEquals(re, ae); }
@Test public void testBoundsWithTranform() throws Exception { SimpleFeatureSource transformed = transformWithExpressions(); assertNull(transformed.getBounds()); }