* @throws NamespaceException
* @throws IOException
*/
public void testGETResponseStringContent() throws ServletException, NamespaceException, IOException
{
HttpService httpService = getHTTPService( registry.getBundleContext() );
String content = "test content";
BasicTestingServlet testServlet = new BasicTestingServlet( content, false );
httpService.registerServlet( "/test", testServlet, null, null );
HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );
client.connect();
assertTrue( client.getResponseCode() == 200 );
String response = readInputAsString( client.getInputStream() );
printBytes( content.getBytes() );
printBytes( response.getBytes() );
assertTrue( content.equals( response ) );
httpService.unregister( "/test" );
content = "test content";
testServlet = new BasicTestingServlet( content, true );
httpService.registerServlet( "/test", testServlet, null, null );
client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );
client.connect();