Java Examples for org.vfny.geoserver.wfs.servlets.TestWfsPost
The following java examples will help you to understand the usage of org.vfny.geoserver.wfs.servlets.TestWfsPost. These source code samples are taken from different open source projects.
Example 1
| Project: geoserver-master File: TestWfsPostTest.java View source code |
@Test
public void testEscapeXMLReservedChars() throws Exception {
TestWfsPost servlet = new TestWfsPost();
MockHttpServletRequest request = buildMockRequest();
request.addHeader("Host", "localhost:8080");
request.setQueryString(ResponseUtils.getQueryString("form_hf_0=&url=vjoce<>:garbage"));
request.setParameter("url", "vjoce<>:garbage");
request.setMethod("GET");
MockHttpServletResponse response = new MockHttpServletResponse();
servlet.service(request, response);
// System.out.println(response.getContentAsString());
// check xml chars have been escaped
assertTrue(response.getContentAsString().contains("java.net.MalformedURLException: no protocol: vjoce<>:garbage"));
}