assertNotNull( "Response body is null.", method.getResponseBodyAsStream() );
}
public void testDuplicateConnection() throws Exception {
this.server.setHttpService(new HttpService() {
public boolean process(SimpleRequest request,
SimpleResponse response) throws IOException {
response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
response.addHeader(new Header("Connection", "close"));
response.addHeader(new Header("Connection", "close"));
return true;
}
});
GetMethod method = new GetMethod("/");
client.executeMethod(method);
method.getResponseBodyAsString();
assertFalse(connectionManager.getConection().isOpen());
this.server.setHttpService(new HttpService() {
public boolean process(SimpleRequest request,
SimpleResponse response) throws IOException {
response.setStatusLine(HttpVersion.HTTP_1_0, 200);
response.addHeader(new Header("Connection", "keep-alive"));
response.addHeader(new Header("Connection", "keep-alive"));