Package com.eviware.soapui.model.mock

Examples of com.eviware.soapui.model.mock.MockRunner


        if (script == null || script.trim().length() == 0) {
            return;
        }

        MockService mockService = getMockOperation().getMockService();
        MockRunner mockRunner = mockService.getMockRunner();
        MockRunContext context =
                mockRunner == null ? new WsdlMockRunContext(mockService, null) : mockRunner.getMockContext();

        context.setMockResponse(this);

        SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine();
View Full Code Here


            String pathInfo = request.getPathInfo();
            if (pathInfo == null) {
                pathInfo = "";
            }

            MockRunner mockRunner = getMatchedMockRunner(getMockRunners(), pathInfo);

            if (mockRunner != null) {
                MockResult result = mockRunner.dispatchRequest(request, response);

                if (maxResults > 0) {
                    synchronized (results) {
                        while (maxResults > 0 && results.size() > maxResults) {
                            results.remove(0);
View Full Code Here

            }
        }

        private MockRunner getMatchedMockRunner(MockRunner[] mockRunners, String pathInfo) {

            MockRunner mockRunner = null;
            String bestMatchedRootPath = "";

            for (MockRunner runner : mockRunners) {
                String mockServicePath = runner.getMockContext().getMockService().getPath();
                if (pathInfo.startsWith(mockServicePath) && mockServicePath.length() > bestMatchedRootPath.length()) {
View Full Code Here

        if (StringUtils.hasContent(dispatchScript)) {
            SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine();

            try {
                MockService mockService = getMockOperation().getMockService();
                MockRunner mockRunner = mockService.getMockRunner();
                MockRunContext context = mockRunner == null ? new WsdlMockRunContext(mockService, null) : mockRunner
                        .getMockContext();

                scriptEngine.setVariable("context", context);
                scriptEngine.setVariable("requestContext", request == null ? null : request.getRequestContext());
                scriptEngine.setVariable("mockRequest", request);
View Full Code Here

            if (port != null) {
                mockService.setPort(Integer.parseInt(port));
            }

            mockService.addMockRunListener(new LogListener());
            MockRunner runner = mockService.start();
            runner.setLogEnabled(false);
            runners.add(runner);
        } catch (Exception e) {
            SoapUI.logError(e);
        }
    }
View Full Code Here

        super("Stop", "Stops the MockService if running");
    }

    public void perform(MockServiceType mockService, Object param) {
        try {
            MockRunner mockRunner = mockService.getMockRunner();
            if (mockRunner != null) {
                mockRunner.stop();
            }
        } catch (Exception e) {
            UISupport.showErrorMessage(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.mock.MockRunner

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.