/**
* Does a test to see that request handling results in expected entries in public access log
* @param httpMethod the {@link HttpMethod} for the request.
* @param uri Uri to be used during the request
* @param testErrorCase true if error case has to be tested, false otherwise
* @param useSSL {@code true} to test SSL logging.
* @throws Exception
*/
private void doRequestHandleTest(HttpMethod httpMethod, String uri, boolean testErrorCase, boolean useSSL)
throws Exception {
EmbeddedChannel channel = createChannel(useSSL);
List<HttpHeaders> httpHeadersList = getHeadersList();
for (HttpHeaders headers : httpHeadersList) {
HttpRequest request = RestTestUtils.createRequest(httpMethod, uri, headers);
HttpUtil.setKeepAlive(request, true);
sendRequestCheckResponse(channel, request, uri, headers, testErrorCase, false, useSSL);
if (!testErrorCase) {
Assert.assertTrue("Channel should not be closed ", channel.isOpen());
} else {
Assert.assertFalse("Channel should have been closed ", channel.isOpen());
channel = createChannel(useSSL);
}
}
channel.close();
}
PublicAccessLogHandlerTest.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:ambry
作者:
评论列表
文章目录