in wilma-functionaltest/src/main/java/com/epam/wilma/gepard/testclient/HttpPostRequestSender.java [59:104]
public ResponseHolder callWilmaTestServer(final WilmaTestCase tc, final RequestParameters requestParameters) throws IOException,
ParserConfigurationException, SAXException {
String responseCode;
ResponseHolder responseMessage;
HttpClient httpClient = new HttpClient();
PostMethod httpPost = new PostMethod(requestParameters.getTestServerUrl());
if (requestParameters.isUseProxy()) {
httpClient.getHostConfiguration().setProxy(requestParameters.getWilmaHost(), requestParameters.getWilmaPort());
}
createRequest(requestParameters, httpPost);
tc.logPostRequestEvent(requestParameters); //this dumps the request
String sendBuffer;
try {
sendBuffer = tc.getTestClassExecutionData().getEnvironment().getProperty("http.socket.sendbuffer");
} catch (NullPointerException e) {
sendBuffer = DEFAULT_BUFFER_SIZE_STRING;
}
String receiveBuffer;
try {
receiveBuffer = tc.getTestClassExecutionData().getEnvironment().getProperty("http.socket.receivebuffer");
} catch (NullPointerException e) {
receiveBuffer = DEFAULT_BUFFER_SIZE_STRING;
}
httpClient.getHttpConnectionManager().getParams().setSendBufferSize(Integer.valueOf(sendBuffer));
httpClient.getHttpConnectionManager().getParams().setReceiveBufferSize(Integer.valueOf(receiveBuffer));
int statusCode;
statusCode = httpClient.executeMethod(httpPost);
responseCode = "status code: " + statusCode + "\n";
responseMessage = createResponse(httpPost);
responseMessage.setResponseCode(responseCode);
tc.setActualResponseCode(statusCode);
Header contentTypeHeader = httpPost.getResponseHeader("Content-Type");
if (contentTypeHeader != null) {
tc.setActualResponseContentType(contentTypeHeader.getValue());
}
Header sequenceHeader = httpPost.getResponseHeader("Wilma-Sequence");
if (sequenceHeader != null) {
tc.setActualDialogDescriptor(sequenceHeader.getValue());
}
tc.logResponseEvent(responseMessage); //this dumps the response
return responseMessage;
}