Package com.eviware.soapui.impl.wsdl.mock

Examples of com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse


                    WsdlMockOperation mockOperation = mockService.getMockOperation(me.getOperation());
                    if (mockOperation == null) {
                        mockOperation = (WsdlMockOperation) mockService.addNewMockOperation(me.getOperation());
                    }

                    WsdlMockResponse mockResponse = mockOperation
                            .addNewMockResponse("Monitor Response " + (++cnt), false);
                    mockResponse.setResponseContent(me.getResponseContent());

                    Attachment[] requestAttachments = me.getResponseAttachments();
                    if (requestAttachments != null) {
                        for (Attachment attachment : requestAttachments) {
                            mockResponse.addAttachment(attachment);
                        }
                    }
                }

                if (cnt == 0) {
View Full Code Here


    private static WsdlMockService makeWsdlMockService() throws SoapUIException {
        return new WsdlMockService(makeWsdlProject(), MockServiceConfig.Factory.newInstance());
    }

    public static WsdlMockResponse makeWsdlMockResponse() throws SoapUIException {
        return new WsdlMockResponse(makeWsdlMockOperation(), MockResponseConfig.Factory.newInstance());
    }
View Full Code Here

                        if (value.equals(XmlUtils.getValueForMatch(cursor))) {
                            WsdlMockRunContext requestContext = (WsdlMockRunContext) request.getRequestContext();
                            requestContext.put("usedQueryMatch", query.getName());

                            WsdlMockResponse resp = null;
                            for (MockResponse mockResponse : this.getMockOperation().getMockResponses()) {
                                if (query.getResponse().equals(mockResponse.getName())) {
                                    resp = (WsdlMockResponse) mockResponse;
                                }
                            }
View Full Code Here

                    + operation.getName() + "]");
            return false;
        }

        WsdlMockOperation mockOperation = (WsdlMockOperation) mockService.addNewMockOperation(operation);
        WsdlMockResponse mockResponse = mockOperation.addNewMockResponse("Response 1", false);

        if (operation.isBidirectional()) {
            mockResponse.setResponseContent(operation.createResponse(true));
        }

        if (UISupport.confirm("Open MockResponse editor?", getName())) {
            SoapUI.getDesktop().showDesktopPanel(mockResponse);
        }
View Full Code Here

        WsdlTestStep testStep = null;
        WsdlTestCase testCase = null;
        WsdlTestSuite testSuite = null;
        WsdlProject project = null;
        WsdlMockService mockService = null;
        WsdlMockResponse mockResponse = null;
        TestPropertyHolder holder = 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 WsdlInterface) {
            project = ((WsdlInterface) modelItem).getProject();
        } else if (modelItem instanceof WsdlProject) {
            project = (WsdlProject) modelItem;
        } else if (modelItem instanceof WsdlMockService) {
            mockService = (WsdlMockService) modelItem;
            project = mockService.getProject();
        } else if (modelItem instanceof AbstractHttpRequestInterface<?>) {
            project = ((AbstractHttpRequest<?>) modelItem).getOperation().getInterface().getProject();
        } else if (modelItem instanceof WsdlMockOperation) {
            mockService = ((WsdlMockOperation) modelItem).getMockService();
            project = mockService.getProject();
        } else if (modelItem instanceof WsdlMockResponse) {
            mockResponse = (WsdlMockResponse) modelItem;
            mockService = mockResponse.getMockOperation().getMockService();
            project = mockService.getProject();
        } else if (modelItem instanceof SecurityTest) {
            securityTest = (SecurityTest) modelItem;
            testCase = securityTest.getTestCase();
            testSuite = testCase.getTestSuite();
View Full Code Here

            if (testRequest != null && testRequest.getOperation() != null
                    && testRequest.getOperation().getInterface() == this) {
                list.add(testRequest);
            }
        } else if (modelItem instanceof WsdlMockResponse) {
            WsdlMockResponse mockResponse = (WsdlMockResponse) modelItem;
            if (mockResponse.getMockOperation() != null && mockResponse.getMockOperation().getOperation() != null
                    && mockResponse.getMockOperation().getOperation().getInterface() == this) {
                list.add(mockResponse);
            }
        }

        // Traverse the ModelItem hierarchy.
View Full Code Here

        WsdlMockOperation mockOperation = mockResponse.getMockOperation();
        mockOperation.beforeSave();
        MockResponseConfig config = mockOperation.getConfig().addNewResponse();
        config.set(mockResponse.getConfig().copy());
        config.setName(name);
        WsdlMockResponse newResponse = mockOperation.addNewMockResponse(config);

        UISupport.selectAndShow(newResponse);
    }
View Full Code Here

        Object result = UISupport.prompt("Select Operation to Mock", "New MockOperation", operations.toArray());
        if (result != null) {
            WsdlOperation operation = ((OperationWrapper) result).getOperation();
            WsdlMockOperation mockOperation = (WsdlMockOperation) mockService.addNewMockOperation(operation);
            WsdlMockResponse mockResponse = mockOperation.addNewMockResponse("Response 1", true);
            UISupport.selectAndShow(mockResponse);
        }
    }
View Full Code Here

                if (req == null) {
                    UISupport.showErrorMessage("Response creation failed");
                } else {
                    for (int c = 0; c < target.getMockResponseCount(); c++) {
                        String msg = req;
                        WsdlMockResponse mockResponse = target.getMockResponseAt(c);

                        if (dialog.getBooleanValue(Form.KEEP_EXISTING)) {
                            msg = XmlUtils.transferValues(mockResponse.getResponseContent(), req);
                        }

                        mockResponse.setResponseContent(msg);
                    }
                }
            }
        }
    }
View Full Code Here

        // add mockoperation
        if (mockOperation == null) {
            mockOperation = (WsdlMockOperation) mockService.addNewMockOperation(request.getOperation());
        }

        WsdlMockResponse mockResponse = mockOperation.addNewMockResponse(
                "Response " + (1 + mockOperation.getMockResponseCount()), false);

        // add expected response if available
        if (request != null && request.getResponse() != null) {
            WsdlResponse response = request.getResponse();
            mockResponse.setResponseContent(response.getContentAsString());

            Attachment[] attachments = response.getAttachments();
            for (Attachment attachment : attachments) {
                mockResponse.addAttachment(attachment);
            }

            if (mockResponse.getResponseHeaders() != null && mockResponse.getResponseHeaders().size() > 0
                    && UISupport.confirm("Add current Response HTTP Headers to MockResponse", title)) {
                mockResponse.setResponseHeaders(response.getResponseHeaders());
            }
        } else {
            mockResponse.setResponseContent(request.getOperation().createResponse(true));
        }

        if (UISupport.confirm("Open MockResponse editor?", title)) {
            SoapUI.getDesktop().showDesktopPanel(mockResponse);
        }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse

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.