Package com.eviware.soapui.model.support

Examples of com.eviware.soapui.model.support.TestStepBeanProperty


            }
        }
    }

    private void addResponseAsXmlVirtualProperty() {
        TestStepBeanProperty responseProperty = new TestStepBeanProperty(WsdlTestStepWithProperties.RESPONSE_AS_XML,
                false, amfRequest, "responseContent", this) {
            @Override
            public String getDefaultValue() {
                return "";
            }
View Full Code Here


            initRequestProperties();
        }
    }

    private void initRequestProperties() {
        addProperty(new TestStepBeanProperty("Endpoint", false, testRequest, "endpoint", this, false));
        addProperty(new TestStepBeanProperty("Username", false, testRequest, "username", this, true));
        addProperty(new TestStepBeanProperty("Password", false, testRequest, "password", this, true));
        addProperty(new TestStepBeanProperty("Domain", false, testRequest, "domain", this, false));
        addProperty(new TestStepBeanProperty("AuthType", false, testRequest, "authType", this, true) {

            @Override
            public String getDefaultValue() {
                // TODO Auto-generated method stub
                return "XXX";
            }
        });

        addProperty(new TestStepBeanProperty("Request", false, testRequest, "requestContent", this, true) {
            @Override
            public String getDefaultValue() {
                return getOperation().createRequest(true);
            }

            @Override
            public SchemaType getSchemaType() {
                try {
                    WsdlInterface iface = getOperation().getInterface();
                    if (WsdlUtils.isRpc(iface.getBinding())) {
                        return WsdlUtils.generateRpcBodyType(getOperation());
                    } else {
                        return iface.getDefinitionContext().getSchemaTypeSystem()
                                .findElement(getOperation().getRequestBodyElementQName()).getType();
                    }
                } catch (Exception e) {
                    SoapUI.logError(e);
                    return XmlString.type;
                }
            }

            @Override
            public QName getType() {
                return getSchemaType().getName();
            }

        });
        addProperty(new TestStepBeanProperty("Response", true, testRequest, "responseContent", this) {
            @Override
            public String getDefaultValue() {
                return getOperation().createResponse(true);
            }
        });
View Full Code Here

        // Add request properties
        refreshRequestProperties();

        // init default properties
        addProperty(new TestStepBeanProperty("Endpoint", false, testRequest, "endpoint", this, false));
        addProperty(new TestStepBeanProperty("Username", false, testRequest, "username", this, true));
        addProperty(new TestStepBeanProperty("Password", false, testRequest, "password", this, true));
        addProperty(new TestStepBeanProperty("Domain", false, testRequest, "domain", this, false));

        // init properties
        addProperty(new TestStepBeanProperty("Request", false, testRequest, "requestContent", this, true) {
            @Override
            public String getDefaultValue() {
                return createDefaultRequestContent();
            }

            public SchemaType getSchemaType() {
                String requestContent = getTestRequest().getRequestContent();
                if (XmlUtils.seemsToBeXml(requestContent)) {

                    try {
                        // first the DOM of the current request
                        Document dom = XmlUtils.parseXml(requestContent);

                        // get matching representations
                        for (RestRepresentation representation : getTestRequest().getRepresentations(Type.REQUEST,
                                getTestRequest().getMediaType())) {
                            // is request element same as that of representation?
                            if (representation.getElement().equals(XmlUtils.getQName(dom.getDocumentElement()))) {
                                // this is it, return its type
                                return representation.getSchemaType();
                            }
                        }
                    } catch (Throwable e) {
                        SoapUI.logError(e);
                    }
                }

                // found nothing.. fall back
                return super.getSchemaType();
            }

            @Override
            public QName getType() {
                return getSchemaType().getName();
            }

        });

        addProperty(new TestStepBeanProperty(WsdlTestStepWithProperties.RESPONSE_AS_XML, true, testRequest,
                "responseContentAsXml", this) {
            @Override
            public String getDefaultValue() {
                return createDefaultResponseXmlContent();
            }

            public SchemaType getSchemaType() {
                try {
                    // first the DOM of the current request
                    Document dom = XmlUtils.parseXml(getTestRequest().getResponseContentAsXml());

                    // get matching representations
                    for (RestRepresentation representation : getTestRequest().getRepresentations(Type.RESPONSE,
                            getTestRequest().getResponse().getContentType())) {
                        // is request element same as that of representation?
                        if (representation.getElement().equals(XmlUtils.getQName(dom.getDocumentElement()))) {
                            // this is it, return its type
                            return representation.getSchemaType();
                        }
                    }
                } catch (Exception e) {
                    SoapUI.logError(e);
                }

                // found nothing.. fall back
                return super.getSchemaType();
            }

            @Override
            public QName getType() {
                return getSchemaType().getName();
            }
        });

        addProperty(new TestStepBeanProperty("Response", true, testRequest, "responseContentAsString", this) {
            @Override
            public String getDefaultValue() {
                return createDefaultRawResponseContent();
            }
        });
View Full Code Here

        initAssertions();
    }

    private void addResponseAsXmlVirtualProperty() {
        TestStepBeanProperty responseProperty = new TestStepBeanProperty(WsdlTestStepWithProperties.RESPONSE_AS_XML,
                true, this, "responseContent", this) {
            @Override
            public String getDefaultValue() {
                return "</no-response>";
            }
View Full Code Here

            public String getValue(DefaultTestStepProperty property) {
                return scriptResult == null ? null : scriptResult.toString();
            }
        }, this));

        addProperty(new TestStepBeanProperty(SCRIPT_PROPERTY, false, this, SCRIPT_PROPERTY, this));

        scriptEngine = SoapUIScriptEngineRegistry.create(this);
        scriptEngine.setScript(getScript());
        if (forLoadTest && !isDisabled()) {
            try {
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.support.TestStepBeanProperty

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.