Include layer group support in the MockData suite
-------------------------------------------------
Key: GEOS-3040
URL: http://jira.codehaus.org/browse/GEOS-3040
Project: GeoServer
Issue Type: Improvement
Reporter: Andrea Aime
Assignee: Andrea Aime
Fix For: 2.0-beta1
I already have 3 tests in need of layer groups. However, MockData support for
groups is non existent, and various changes are needed to add those.
The code I'm duplicating looks like this:
{code}
@Override
protected void setUpInternal() throws Exception {
Catalog catalog = getCatalog();
String lakes = MockData.LAKES.getLocalPart();
String forests = MockData.FORESTS.getLocalPart();
String bridges = MockData.BRIDGES.getLocalPart();
setNativeBox(catalog, lakes);
setNativeBox(catalog, forests);
setNativeBox(catalog, bridges);
LayerGroupInfo lg = catalog.getFactory().createLayerGroup();
lg.setName("lakes");
lg.getLayers().add(catalog.getLayerByName(lakes));
lg.getStyles().add(catalog.getStyleByName(lakes));
lg.getLayers().add(catalog.getLayerByName(forests));
lg.getStyles().add(catalog.getStyleByName(forests));
lg.getLayers().add(catalog.getLayerByName(bridges));
lg.getStyles().add(catalog.getStyleByName(bridges));
CatalogBuilder builder = new CatalogBuilder(catalog);
builder.calculateLayerGroupBounds(lg);
catalog.add(lg);
}
public void setNativeBox(Catalog catalog, String name) throws Exception {
FeatureTypeInfo fti = catalog.getFeatureTypeByName(name);
fti.setNativeBoundingBox(fti.getFeatureSource(null, null).getBounds());
fti.setLatLonBoundingBox(new
ReferencedEnvelope(fti.getNativeBoundingBox(), DefaultGeographicCRS.WGS84));
catalog.save(fti);
}
{code}
Note how there is a need to post-compute the layer bounds since MockData does
not do this (mind MockData works at the fs level, not at the Catalog level, the
catalog is then loaded form the fs), and also the group itself cannot be taken
for granted as a test can decide not to include the default set of data.
Finally, MockData needs rewriting (imho) to deal with the new fs layout and
persistence, and/or get rid of fs dependence and just unpack the data somewhere
and build the catalog in memory instead.
Anyways, when some support for groups is added factor out the duplicated code
in LayerGroupBaseTest, CascadeDeleteVisitorTest and ReachableObjectsVisitorTest
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel