searchCriterion.setOperator("like");
searchCriterion.setValue("'%3'");
request.setCriteria(new SearchCriterion[] {searchCriterion});
// execute
SearchFeatureResponse response = (SearchFeatureResponse) dispatcher.execute(
SearchFeatureRequest.COMMAND, request, null, "en");
// test
Assert.assertFalse(response.isError());
Assert.assertEquals(LAYER_ID, response.getLayerId());
Feature[] features = response.getFeatures();
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);