Package com.eviware.soapui.model.mock

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


        super(modelItem);
        modelItem.addPropertyChangeListener(propertyChangeListener);
    }

    protected JComponent buildContent() {
        MockResponse mockResponse = getMockResponse();

        createEmptyButton = createActionButton(new CreateEmptyWsdlMockResponseAction(mockResponse), isBidirectional());
        createFaultButton = createActionButton(new CreateFaultWsdlMockResponseAction(mockResponse), isBidirectional());
        wsiValidateAction = SwingActionDelegate.createDelegate(new WSIValidateResponseAction(), mockResponse, "alt W");
View Full Code Here


            MockResult lastMockResult = getMockOperation().getLastMockResult();
            MockRequest mockRequest = lastMockResult == null ? null : lastMockResult.getMockRequest();

            try {
                MockResponse retVal = selectMockResponse(mockRequest, null);
                UISupport.showInfoMessage("Script returned [" + (retVal == null ? "null" : retVal.getName()) + "]");
            } catch (Exception e1) {
                UISupport.showErrorMessage(e1);
            }
        }
View Full Code Here

            throw new DispatchException("Missing dispatch XPath expression");
        }

        String[] values = XmlUtils.selectNodeValues(xmlObject, path);
        for (String value : values) {
            MockResponse mockResponse = getMockOperation().getMockResponseByName(value);
            if (mockResponse != null) {
                return mockResponse;
            }
        }
View Full Code Here

                UISupport.showErrorMessage("Missing last request to select from");
                return;
            }

            try {
                MockResponse retVal = selectMockResponse(lastMockResult.getMockRequest(), null);
                UISupport.showInfoMessage("XPath Selection returned [" + (retVal == null ? "null" : retVal.getName())
                        + "]");
            } catch (Exception e1) {
                SoapUI.logError(e1);
            }
        }
View Full Code Here

        }

        try {
            RestMockResult result = new RestMockResult(request);

            MockResponse mockResponse = getDispatcher().selectMockResponse(request, result);

            result.setMockResponse(mockResponse);

            result.setMockOperation(this);

            if (mockResponse == null) {
                mockResponse = getMockResponseByName(this.getDefaultResponse());
            }

            if (mockResponse == null) {
                throw new DispatchException("Failed to find MockResponse");
            }

            result.setMockResponse(mockResponse);
            mockResponse.execute(request, result);

            return result;
        } catch (Exception e) {
            throw new DispatchException(e);
        }
View Full Code Here

        WsdlTestStep testStep;
        WsdlTestCase testCase = null;
        WsdlTestSuite testSuite = null;
        WsdlProject project = null;
        MockService mockService = null;
        MockResponse mockResponse = null;
        SecurityTest securityTest = null;

        if (modelItem instanceof WsdlTestStep) {
            testStep = (WsdlTestStep) modelItem;
            testCase = testStep.getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlTestCase) {
            testCase = (WsdlTestCase) modelItem;
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlTestSuite) {
            testSuite = (WsdlTestSuite) modelItem;
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlMockService) {
            project = ((WsdlMockService) modelItem).getProject();
        } else if (modelItem instanceof MockResponse) {
            mockResponse = (MockResponse) modelItem;
            mockService = (mockResponse).getMockOperation().getMockService();
            project = mockService.getProject();
        } else if (modelItem instanceof WsdlProject) {
            project = (WsdlProject) modelItem;
        } else if (modelItem instanceof AbstractHttpRequestInterface<?>) {
            project = ((AbstractHttpRequest<?>) modelItem).getOperation().getInterface().getProject();
        } else if (modelItem instanceof Operation) {
            project = (WsdlProject) ((Operation) modelItem).getInterface().getProject();
        } else if (modelItem instanceof SecurityTest) {
            securityTest = (SecurityTest) modelItem;
            testCase = securityTest.getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        }

        TestPropertyHolder globalProperties = PropertyExpansionUtils.getGlobalProperties();
        if (globalProperties.getProperties().size() > 0) {
            targetMenu.add(createPropertyMenu("Global", globalProperties));
        }

        if (project != null) {
            targetMenu.add(createPropertyMenu("Project: [" + project.getName() + "]", project));
        }

        if (testSuite != null) {
            targetMenu.add(createPropertyMenu("TestSuite: [" + testSuite.getName() + "]", testSuite));
        }

        if (mockService != null) {
            targetMenu.add(createPropertyMenu("MockService: [" + mockService.getName() + "]", mockService));
        }

        if (mockResponse != null) {
            targetMenu.add(createPropertyMenu("MockResponse: [" + mockResponse.getName() + "]", mockResponse));
        }

        if (testCase != null) {
            targetMenu.add(createPropertyMenu("TestCase: [" + testCase.getName() + "]", testCase));
View Full Code Here

TOP

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

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.