Package com.consol.citrus.validation.xml

Examples of com.consol.citrus.validation.xml.XmlMessageValidationContext


     * Creates new validation context according to message type.
     */
    private void initializeValidationContext() {
        if (validationContext == null) {
            if (messageType.equals(MessageType.XML)) {
                validationContext = new XmlMessageValidationContext();
            } else {
                validationContext = new ControlMessageValidationContext(messageType.toString());
            }

            action.getValidationContexts().add(validationContext);
View Full Code Here


                } else {
                    throw new BeanCreationException("Not content for fault-detail is set! Either use file attribute or inline text value for fault-detail element.");
                }
            }
           
            XmlMessageValidationContext context = new XmlMessageValidationContext();
            String schemaValidation = faultDetailElement.getAttribute("schema-validation");
            if (StringUtils.hasText(schemaValidation)) {
                context.setSchemaValidation(Boolean.valueOf(schemaValidation));
            }
           
            String schema = faultDetailElement.getAttribute("schema");
            if (StringUtils.hasText(schema)) {
                context.setSchema(schema);
            }
           
            String schemaRepository = faultDetailElement.getAttribute("schema-repository");
            if (StringUtils.hasText(schemaRepository)) {
                context.setSchemaRepository(schemaRepository);
            }
            validationContext.addValidationContext(context);
        }
       
        if (!soapFaultDetails.isEmpty() || !soapFaultDetailPaths.isEmpty()) {
View Full Code Here

                "<ws:stacktrace>N/A</ws:stacktrace>" +
            "</ws:ErrorDetails>";
   
    @Test
    public void testXmlDetailValidation() {
        soapFaultValidator.validateFaultDetailString(detail, detail, context, new XmlMessageValidationContext());
    }
View Full Code Here

        SoapFault receivedDetail = new SoapFault();
        receivedDetail.addFaultDetail(error);
        SoapFault controlDetail = new SoapFault();
        controlDetail.addFaultDetail(error);

        soapFaultValidator.validateFaultDetail(receivedDetail, controlDetail, context, new XmlMessageValidationContext());
    }
View Full Code Here

        SoapFault receivedDetail = new SoapFault();
        receivedDetail.addFaultDetail(error.replaceFirst("1001", "1002"));
        SoapFault controlDetail = new SoapFault();
        controlDetail.addFaultDetail(error);

        soapFaultValidator.validateFaultDetail(receivedDetail, controlDetail, context, new XmlMessageValidationContext());
    }
View Full Code Here

        receivedDetail.addFaultDetail(detail);
        SoapFault controlDetail = new SoapFault();
        controlDetail.addFaultDetail(error);
        controlDetail.addFaultDetail(detail);

        soapFaultValidator.validateFaultDetail(receivedDetail, controlDetail, context, new XmlMessageValidationContext());
    }
View Full Code Here

        receivedDetail.addFaultDetail(detail);
        SoapFault controlDetail = new SoapFault();
        controlDetail.addFaultDetail(error.replaceFirst("1001", "1002"));
        controlDetail.addFaultDetail(detail);

        soapFaultValidator.validateFaultDetail(receivedDetail, controlDetail, context, new XmlMessageValidationContext());
    }
View Full Code Here

        soapMessageAction.setEndpoint(endpoint);
        soapMessageAction.setAttachmentValidator(attachmentValidator);

        soapMessageAction.setValidator(new DomXmlMessageValidator());
        PayloadTemplateMessageBuilder controlMessageBuilder = new PayloadTemplateMessageBuilder();
        XmlMessageValidationContext validationContext = new XmlMessageValidationContext();
        validationContext.setMessageBuilder(controlMessageBuilder);
        controlMessageBuilder.setPayloadData("<TestRequest><Message>Hello World!</Message></TestRequest>");

        SoapAttachment attachment = new SoapAttachment();
        attachment.setContent("TestAttachment!");
        soapMessageAction.setAttachments(Collections.singletonList(attachment));
View Full Code Here

        soapMessageAction.setEndpoint(endpoint);
        soapMessageAction.setAttachmentValidator(attachmentValidator);

        soapMessageAction.setValidator(new DomXmlMessageValidator());
        PayloadTemplateMessageBuilder controlMessageBuilder = new PayloadTemplateMessageBuilder();
        XmlMessageValidationContext validationContext = new XmlMessageValidationContext();
        validationContext.setMessageBuilder(controlMessageBuilder);
        controlMessageBuilder.setPayloadData("<TestRequest><Message>Hello World!</Message></TestRequest>");

        SoapAttachment attachment = new SoapAttachment();
        attachment.setContentId("myAttachment");
        attachment.setContentType("text/xml");
View Full Code Here

        soapMessageAction.setEndpoint(endpoint);
        soapMessageAction.setAttachmentValidator(attachmentValidator);

        soapMessageAction.setValidator(new DomXmlMessageValidator());
        PayloadTemplateMessageBuilder controlMessageBuilder = new PayloadTemplateMessageBuilder();
        XmlMessageValidationContext validationContext = new XmlMessageValidationContext();
        validationContext.setMessageBuilder(controlMessageBuilder);
        controlMessageBuilder.setPayloadData("<TestRequest><Message>Hello World!</Message></TestRequest>");

        List<SoapAttachment> attachments = new ArrayList<SoapAttachment>();
        SoapAttachment attachment = new SoapAttachment();
        attachment.setContentId("1stAttachment");
View Full Code Here

TOP

Related Classes of com.consol.citrus.validation.xml.XmlMessageValidationContext

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.