public ResponseHolder callWilmaTestServer()

in wilma-functionaltest/src/main/java/com/epam/wilma/gepard/testclient/MultiStubHttpPostRequestSender.java [55:86]


    public ResponseHolder callWilmaTestServer(final WilmaTestCase tc, final MultiStubRequestParameters 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);
        httpClient.getHttpConnectionManager().getParams()
                .setSendBufferSize(Integer.valueOf(tc.getTestClassExecutionData().getEnvironment().getProperty("http.socket.sendbuffer")));
        httpClient.getHttpConnectionManager().getParams()
                .setReceiveBufferSize(Integer.valueOf(tc.getTestClassExecutionData().getEnvironment().getProperty("http.socket.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());
        }

        return responseMessage;
    }