raw.put("hopCount", "10");
raw.put("responsehandler", "http://www.geoserver.org");
GetRecordsKvpRequestReader reader = new GetRecordsKvpRequestReader();
reader.setApplicationContext(applicationContext);
Object request = reader.createRequest();
GetRecordsType gr = (GetRecordsType) reader.read(request, parseKvp(raw), raw);
// basic checks
assertEquals("CSW", gr.getService());
assertEquals("2.0.2", gr.getVersion());
assertEquals(ResultType.RESULTS, gr.getResultType());
assertEquals("myId", gr.getRequestId());
assertEquals("application/xml", gr.getOutputFormat());
assertEquals("http://www.opengis.net/cat/csw/2.0.2", gr.getOutputSchema());
assertNotNull(gr.getDistributedSearch());
assertEquals(new Integer(10), gr.getDistributedSearch().getHopCount());
assertEquals("http://www.geoserver.org", gr.getResponseHandler());
// now onto the query
QueryType query = (QueryType) gr.getQuery();
assertEquals("AnyText like '%pollution%'", query.getConstraint().getCqlText());
assertEquals(2, query.getTypeNames().size());
assertEquals(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"), query
.getTypeNames().get(0));
assertEquals(new QName("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "RegistryPackage"),