Package com.eviware.soapui.support.types

Examples of com.eviware.soapui.support.types.StringToStringsMap


    }

    protected void initHeadersForLoadTest(ExtendedHttpMethod httpMethod) {
        try {
            requestHeaders = new StringToStringsMap();
            Header[] headers = httpMethod.getAllHeaders();
            for (Header header : headers) {
                requestHeaders.put(header.getName(), header.getValue());
            }

            if (!httpMethod.isFailed() && httpMethod.hasHttpResponse()) {
                responseHeaders = new StringToStringsMap();
                headers = httpMethod.getHttpResponse().getAllHeaders();
                for (Header header : headers) {
                    responseHeaders.put(header.getName(), header.getValue());
                }
View Full Code Here


        this.response = response;
        this.context = context;

        requestContext = new WsdlMockRunContext(context.getMockService(), null);

        requestHeaders = new StringToStringsMap();
        for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements(); ) {
            String header = (String) e.nextElement();
            String lcHeader = header.toLowerCase();
            if (lcHeader.equals("soapaction")) {
                requestHeaders.put("SOAPAction", request.getHeader(header));
View Full Code Here

    public String getResponseContent() {
        return null;
    }

    public StringToStringsMap getResponseHeaders() {
        return new StringToStringsMap();
    }
View Full Code Here

    public String getResponseContent() {
        return mockResult == null ? null : mockResult.getResponseContent();
    }

    public StringToStringsMap getResponseHeaders() {
        return mockResult == null ? new StringToStringsMap() : mockResult.getResponseHeaders();
    }
View Full Code Here

        out.print("<h4>Details for MockResult at " + new java.util.Date(result.getTimestamp()) + " ("
                + result.getTimeTaken() + "ms)</h4>");

        out.println("<hr/><p><b>Request Headers</b>:</p>");
        out.print("<table border=\"1\"><tr><td>Header</td><td>Value</td></tr>");
        StringToStringsMap headers = result.getMockRequest().getRequestHeaders();
        for (String name : headers.getKeys()) {
            for (String value : headers.get(name)) {
                out.println("<tr><td>" + name + "</td><td>" + value + "</td></tr>");
            }
        }
        out.println("</table>");

        out.println("<hr/><b>Incoming Request</b>:<br/><pre>"
                + XmlUtils.entitize(result.getMockRequest().getRequestContent()) + "</pre>");

        out.println("<hr/><p><b>Response Headers</b>:</p>");
        out.print("<table border\"1\"><tr><td>Header</td><td>Value</td></tr>");
        headers = result.getResponseHeaders();
        for (String name : headers.getKeys()) {
            for (String value : headers.get(name)) {
                out.println("<tr><td>" + name + "</td><td>" + value + "</td></tr>");
            }
        }
        out.println("</table>");
View Full Code Here

     *
     * @param requestHeaders
     * @return
     */
    private StringToStringsMap excludeProxyHeaders(StringToStringsMap requestHeaders) {
        StringToStringsMap stsmap = new StringToStringsMap();
        for (String key : requestHeaders.getKeys()) {
            if (!(key.contains("Proxy") || key.contains("Content"))) {
                stsmap.add(key, requestHeaders.get(key, ""));
            }
        }
        return stsmap;
    }
View Full Code Here

        try {
            Settings settings = httpRequest.getSettings();

            // custom http headers last so they can be overridden
            StringToStringsMap headers = httpRequest.getRequestHeaders();

            // clear headers specified in GUI, and re-add them, with property expansion
            for (String headerName : headers.keySet()) {
                String expandedHeaderName = PropertyExpander.expandProperties(submitContext, headerName);
                httpMethod.removeHeaders(expandedHeaderName);
                for (String headerValue : headers.get(headerName)) {
                    headerValue = PropertyExpander.expandProperties(submitContext, headerValue);
                    httpMethod.addHeader(expandedHeaderName, headerValue);
                }
            }
View Full Code Here

        compressedResponseContent.setStringValue(responseContent);
        getConfig().setResponseContent(compressedResponseContent);
    }

    public StringToStringsMap getResponseHeaders() {
        StringToStringsMap result = new StringToStringsMap();
        List<HeaderConfig> headerList = getConfig().getHeaderList();
        for (HeaderConfig header : headerList) {
            result.add(header.getName(), header.getValue());
        }

        return result;
    }
View Full Code Here

            // casting below cause WsdlMockRunContext is both a MockRunContext AND a Map<String,Object>
            context.putAll((WsdlMockRunContext) request.getContext());
            context.putAll((WsdlMockRunContext) request.getRequestContext());

            StringToStringsMap responseHeaders = getResponseHeaders();
            for (Map.Entry<String, List<String>> headerEntry : responseHeaders.entrySet()) {
                for (String value : headerEntry.getValue()) {
                    result.addHeader(headerEntry.getKey(), PropertyExpander.expandProperties(context, value));
                }
            }
View Full Code Here

        return responseContent;
    }

    private boolean headerExists(String headerName, String headerValue, MockResult result) {
        StringToStringsMap resultResponseHeaders = result.getResponseHeaders();

        if (resultResponseHeaders.containsKeyIgnoreCase(headerName)) {
            if (resultResponseHeaders.get(headerName).contains(headerValue)) {
                return true;
            }
        }

        return false;
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.types.StringToStringsMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.