Assert.assertNotNull(features);
Assert.assertEquals(1, features.length);
Assert.assertEquals("Country 3", features[0].getLabel());
Geometry geometry = features[0].getGeometry();
Assert.assertNotNull(geometry);
Coordinate coor = geometry.getGeometries()[0].getGeometries()[0].getCoordinates()[0];
Assert.assertEquals(-1, coor.getX(), DOUBLE_TOLERANCE);
Assert.assertEquals(0, coor.getY(), DOUBLE_TOLERANCE);
// try again using mercator
request.setCrs("EPSG:900913");
response = (SearchFeatureResponse) dispatcher.execute(SearchFeatureRequest.COMMAND, request, null, "en");
if (response.isError()) {
response.getErrors().get(0).printStackTrace();
}
Assert.assertFalse(response.isError());
Assert.assertEquals(LAYER_ID, response.getLayerId());
features = response.getFeatures();
Assert.assertNotNull(features);
Assert.assertEquals(1, features.length);
Assert.assertEquals("Country 3", features[0].getLabel());
geometry = features[0].getGeometry();
Assert.assertNotNull(geometry);
coor = geometry.getGeometries()[0].getCoordinates()[0];
// remark, this value is obtained using a test run, not externally verified
Assert.assertEquals(-111319.49079327357, coor.getX(), DOUBLE_TOLERANCE);
Assert.assertEquals(0, coor.getY(), DOUBLE_TOLERANCE);
}