Package com.eviware.soapui.model.settings

Examples of com.eviware.soapui.model.settings.Settings


            });
        }
    }

    public static void initGCTimer() {
        Settings settings = SoapUI.getSettings();
        long interval = settings.getLong(UISettings.GC_INTERVAL, 60);

        if (gcTimerTask != null) {
            if (interval == 0) {
                SoapUI.log("Cancelling GC Timer");
            }
View Full Code Here


        for (RequestFilter filter : filters) {
            filter.filterRequest(submitContext, httpRequest);
        }

        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);
                }
            }

            // do request
            WsdlProject project = (WsdlProject) ModelSupport.getModelItemProject(httpRequest);
            WssCrypto crypto = null;
            if (project != null && project.getWssContainer() != null) {
                crypto = project.getWssContainer().getCryptoByName(
                        PropertyExpander.expandProperties(submitContext, httpRequest.getSslKeystore()));
            }

            if (crypto != null && WssCrypto.STATUS_OK.equals(crypto.getStatus())) {
                httpMethod.getParams().setParameter(SoapUIHttpRoute.SOAPUI_SSL_CONFIG,
                        crypto.getSource() + " " + crypto.getPassword());
            }

            // dump file?
            httpMethod.setDumpFile(PathUtils.expandPath(httpRequest.getDumpFile(),
                    (AbstractWsdlModelItem<?>) httpRequest, submitContext));

            // include request time?
            if (settings.getBoolean(HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN)) {
                httpMethod.initStartTime();
            }

            if (httpMethod.getMetrics() != null) {
                httpMethod.getMetrics().setHttpMethod(httpMethod.getMethod());
View Full Code Here

public class HttpSettingsRequestFilter extends AbstractRequestFilter {
    public void filterAbstractHttpRequest(SubmitContext context, AbstractHttpRequest<?> httpRequest) {
        ExtendedHttpMethod httpMethod = (ExtendedHttpMethod) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);

        // set maxsize
        Settings settings = httpRequest.getSettings();

        // close connections?
        if (settings.getBoolean(HttpSettings.CLOSE_CONNECTIONS)) {
            httpMethod.setHeader("Connection", "close");
        }

        // close connections?
        if (settings.getBoolean(HttpSettings.EXPECT_CONTINUE) && httpMethod instanceof HttpEntityEnclosingRequest) {
            httpMethod.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.TRUE);
        }

        // compress request?
        String compressionAlg = settings.getString(HttpSettings.REQUEST_COMPRESSION, "None");
        if (!"None".equals(compressionAlg)) {
            httpMethod.setHeader("Content-Encoding", compressionAlg);
        }

        // accept compressed responses?
        if (settings.getBoolean(HttpSettings.RESPONSE_COMPRESSION)) {
            httpMethod.setHeader("Accept-Encoding", CompressionSupport.getAvailableAlgorithms(","));
        }

        String httpVersion = settings.getString(HttpSettings.HTTP_VERSION, "1.1");
        if (httpVersion.equals(HttpSettings.HTTP_VERSION_1_1)) {
            httpMethod.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
        } else if (httpVersion.equals(HttpSettings.HTTP_VERSION_1_0)) {
            httpMethod.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_0);
        } else if (httpVersion.equals(HttpSettings.HTTP_VERSION_0_9)) {
            httpMethod.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
        }

        // max size..
        long maxSize = httpRequest.getMaxSize();
        if (maxSize == 0) {
            maxSize = settings.getLong(HttpSettings.MAX_RESPONSE_SIZE, 0);
        }
        if (maxSize > 0) {
            httpMethod.setMaxSize(maxSize);
        }
View Full Code Here

public class PostPackagingRequestFilter extends AbstractRequestFilter {

    @Override
    public void filterAbstractHttpRequest(SubmitContext context, AbstractHttpRequest<?> request) {
        ExtendedHttpMethod httpMethod = (ExtendedHttpMethod) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);
        Settings settings = request.getSettings();

        // chunking?
        if (httpMethod.getProtocolVersion().equals(HttpVersion.HTTP_1_1)
                && httpMethod instanceof HttpEntityEnclosingRequest) {
            HttpEntityEnclosingRequest entityEnclosingMethod = ((HttpEntityEnclosingRequest) httpMethod);
            long limit = settings.getLong(HttpSettings.CHUNKING_THRESHOLD, -1);
            HttpEntity requestEntity = entityEnclosingMethod.getEntity();
            if (requestEntity != null && requestEntity instanceof AbstractHttpEntity) {
                ((AbstractHttpEntity) requestEntity).setChunked(limit >= 0 ? requestEntity.getContentLength() > limit
                        : false);
            }
View Full Code Here

        } catch (Exception e1) {
            SoapUI.logError(e1);
        }

        if (!httpMethod.isFailed()) {
            Settings settings = httpRequest.getSettings();

            try {
                rawResponseBody = httpMethod.getResponseBody();
            } catch (IOException e) {
                e.printStackTrace();
            }

            if (settings.getBoolean(HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN)) {
                timeTaken += httpMethod.getResponseReadTime();
            }

            // metrics.getReadTimer().add( httpMethod.getResponseReadTimeNanos() );
            // metrics.getTotalTimer().add( httpMethod.getResponseReadTimeNanos() );
View Full Code Here

        // check for authorization prerequisites
        if (username == null || username.length() == 0) {
            return;
        }

        Settings settings = wsdlRequest.getSettings();
        String password = PropertyExpander.expandProperties(context, wsdlRequest.getPassword());
        String domain = PropertyExpander.expandProperties(context, wsdlRequest.getDomain());

        Enum authType = Enum.forString(wsdlRequest.getAuthType());
View Full Code Here

                            LaunchForm.SET_CONTENT_TYPES,
                            project.getSettings().getString(LaunchForm.SET_CONTENT_TYPES,
                                    SoapMonitorAction.defaultContentTypes().toString()));

            if (optionsDialog.show()) {
                Settings settings = getProject().getSettings();

                settings.setLong(OptionsForm.PORT, listenPort = optionsDialog.getIntValue(OptionsForm.PORT, listenPort));
                settings.setLong(OptionsForm.MAXROWS, maxRows = optionsDialog.getIntValue(OptionsForm.MAXROWS, maxRows));
                settings.setString(LaunchForm.SET_CONTENT_TYPES, optionsDialog.getValue(LaunchForm.SET_CONTENT_TYPES));

                incomingRequestWss = optionsDialog.getValue(OptionsForm.REQUEST_WSS);
                incomingResponseWss = optionsDialog.getValue(OptionsForm.RESPONSE_WSS);

                tableModel.fitSizeToMaxRows();
View Full Code Here

        this.path = path;
        getWorkspace().reloadProject(this);
    }

    public boolean hasNature(String natureId) {
        Settings projectSettings = getSettings();
        String projectNature = projectSettings.getString(ProjectSettings.PROJECT_NATURE, null);
        return natureId.equals(projectNature);
    }
View Full Code Here

    private void readMultipartRequest(HttpServletRequest request) throws MessagingException {
        StringToStringMap values = StringToStringMap.fromHttpHeader(request.getContentType());
        MockRequestDataSource mockRequestDataSource = new MockRequestDataSource(request);
        setMockRequestDataSource(mockRequestDataSource);
        Settings settings = getRequestContext().getMockService().getSettings();
        boolean isPrettyPrint = settings.getBoolean(WsdlSettings.PRETTY_PRINT_RESPONSE_MESSAGES);
        MultipartMessageSupport mmSupport = new MultipartMessageSupport(mockRequestDataSource, values.get("start"), null, true, isPrettyPrint);
        setMultipartMessageSupport(mmSupport);
    }
View Full Code Here

    public boolean isRunning() {
        return server.isRunning();
    }

    public void start(WsdlProject project, int localPort, SoapMonitorListenerCallBack listenerCallBack) {
        Settings settings = project.getSettings();
        server.setThreadPool(new SoapUIJettyThreadPool());
        Context context = new Context(server, ROOT, 0);

        if (!StringUtils.isNullOrEmpty(sslEndpoint)) {
            if (sslEndpoint.startsWith(HTTPS)) {
                sslConnector = new SslSocketConnector();
                sslConnector
                        .setKeystore(settings.getString(SoapMonitorAction.SecurityTabForm.SSLTUNNEL_KEYSTORE, "JKS"));
                sslConnector.setPassword(settings.getString(SoapMonitorAction.SecurityTabForm.SSLTUNNEL_PASSWORD, ""));
                sslConnector.setKeyPassword(settings.getString(SoapMonitorAction.SecurityTabForm.SSLTUNNEL_KEYPASSWORD,
                        ""));
                sslConnector.setTruststore(settings.getString(SoapMonitorAction.SecurityTabForm.SSLTUNNEL_TRUSTSTORE,
                        "JKS"));
                sslConnector.setTrustPassword(settings.getString(
                        SoapMonitorAction.SecurityTabForm.SSLTUNNEL_TRUSTSTORE_PASSWORD, ""));
                sslConnector.setNeedClientAuth(false);
                sslConnector.setMaxIdleTime(30000);
                sslConnector.setPort(localPort);
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.settings.Settings

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.