throw new RuntimeException("Test failed with seed " + seed, e);
}
}
public void runTest(final String theMessage) throws IOException {
ContentEncodingHttpClient client = new ContentEncodingHttpClient();
try {
message = theMessage;
HttpGet get = new HttpGet(DefaultServer.getDefaultServerURL() + "/path");
get.setHeader(Headers.ACCEPT_ENCODING_STRING, "gzip");
HttpResponse result = client.execute(get);
Assert.assertEquals(200, result.getStatusLine().getStatusCode());
Header[] header = result.getHeaders(Headers.CONTENT_ENCODING_STRING);
Assert.assertEquals("gzip", header[0].getValue());
final String body = HttpClientUtils.readResponse(result);
Assert.assertEquals(theMessage, body);
} finally {
client.getConnectionManager().shutdown();
}
}