* Assert the encoding of the request as a Region inside the NetworkLink
*
* @see KMLNetworkLinkTransformer#setEncodeAsRegion(boolean)
*/
public void testEncodeAsRegion() throws Exception {
XpathEngine xpath = XMLUnit.newXpathEngine();
KMLNetworkLinkTransformer transformer = new KMLNetworkLinkTransformer();
transformer.setEncodeAsRegion(true);
transformer.setIndentation(2);
request.setBbox(new Envelope(-1, 1, -10, 10));
Document dom = WMSTestSupport.transform(request, transformer);
assertXpathEvaluatesTo("1", "count(//kml/Folder)", dom);
assertXpathEvaluatesTo("1", "count(//kml/Folder/NetworkLink)", dom);
assertXpathEvaluatesTo("1", "count(//kml/Folder/LookAt)", dom);
assertXpathEvaluatesTo("geos:TestPoints", "//kml/Folder/NetworkLink/name", dom);
assertXpathEvaluatesTo("1", "//kml/Folder/NetworkLink/open", dom);
assertXpathEvaluatesTo("1", "//kml/Folder/NetworkLink/visibility", dom);
// should match the request BBOX
assertXpathEvaluatesTo("10.0", "//kml/Folder/NetworkLink/Region/LatLonAltBox/north", dom);
assertXpathEvaluatesTo("-10.0", "//kml/Folder/NetworkLink/Region/LatLonAltBox/south", dom);
assertXpathEvaluatesTo("1.0", "//kml/Folder/NetworkLink/Region/LatLonAltBox/east", dom);
assertXpathEvaluatesTo("-1.0", "//kml/Folder/NetworkLink/Region/LatLonAltBox/west", dom);
assertXpathEvaluatesTo("256", "//kml/Folder/NetworkLink/Region/Lod/minLodPixels", dom);
assertXpathEvaluatesTo("-1", "//kml/Folder/NetworkLink/Region/Lod/maxLodPixels", dom);
final Map<String, String> expectedKvp = KMLReflectorTest.toKvp("http://geoserver.org:8181/geoserver/wms?format_options=relLinks%3Atrue%3B&service=wms&srs=EPSG%3A4326&width=512&styles=Default+Style&height=256&transparent=false&bbox=-1.0%2C-10.0%2C1.0%2C10.0&request=GetMap&layers=geos%3ATestPoints&format=image%2Fdummy&version=1.1.1");
final Map<String, String> actualKvp = KMLReflectorTest.toKvp(xpath.evaluate(
"//kml/Folder/NetworkLink/Link/href", dom));
KMLReflectorTest.assertMapsEqual(expectedKvp, actualKvp);
assertXpathEvaluatesTo("onRegion", "//kml/Folder/NetworkLink/Link/viewRefreshMode", dom);
// feature type bounds?