Package org.apache.synapse

Examples of org.apache.synapse.TestMessageContextBuilder


        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromStaticKey("xsd-key"));
        validate.setSource(createXPath("//m0:CheckPriceRequest"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .setBodyFromString(VALID_ENVELOPE).build();

        // test validate mediator, with static enveope
        test(validate, synCtx, false);
View Full Code Here


        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromMoreKeys("xsd-key-1", "xsd-key-2"));
        validate.setSource(createXPath("//m1:Outer"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .addFileEntry("xsd-key-2", "./../../repository/conf/sample/resources/validate/validate2.xsd")
                .setBodyFromString(VALID_ENVELOPE_TWO_SCHEMAS).build();

        // test validate mediator, with static enveope
View Full Code Here

        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromMoreKeys("xsd-key-1", "xsd-key-2"));
        validate.setSource(createXPath("//m1:Outer"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .addFileEntry("xsd-key-2", "./../../repository/conf/sample/resources/validate/validate2.xsd")
                .setBodyFromString(INVALID_ENVELOPE_TWO_SCHEMAS).build();

        // test validate mediator, with static enveope
View Full Code Here

        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromStaticKey("xsd-key-1"));
        validate.setSource(createXPath("//m0:CheckPriceRequest"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .setBodyFromString(IN_VALID_ENVELOPE).build();

        // test validate mediator, with static enveope
        test(validate, synCtx, true);
View Full Code Here

        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromStaticKey("xsd-key-1"));
        validate.setSource(createXPath("//m0:CheckPriceRequest"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .setBodyFromString(VALID_ENVELOPE_NO_NS).build();

        // test validate mediator, with static enveope
        test(validate, synCtx, false);
View Full Code Here

        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromStaticKey("xsd-key-1"));
        validate.setSource(createXPath("//m0:CheckPriceRequest"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .setBodyFromString(IN_VALID_ENVELOPE_NO_NS).build();

        // test validate mediator, with static enveope
        test(validate, synCtx, true);
View Full Code Here

    private void makeValidInvocation(ValidateMediator validate) throws Exception {
        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(createKeyListFromStaticKey("xsd-key-1"));
        validate.setSource(createXPath("//m0:CheckPriceRequest"));

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry("xsd-key-1", "./../../repository/conf/sample/resources/validate/validate.xsd")
                .setBodyFromString(VALID_ENVELOPE).build();

        // test validate mediator, with static enveope
        test(validate, synCtx, false);
View Full Code Here

        } else {
            // set the schema url using static key
            validate.setSchemaKeys(createKeyListFromStaticKey(xsdKeyValue));
        }

        MessageContext synCtx = new TestMessageContextBuilder()
                .addFileEntry(xsdKeyValue, "./../../repository/conf/sample/resources/validate/" + xsdFile + ".xsd")
                .setBodyFromString(source).build();

        test(validate, synCtx, false);
    }
View Full Code Here

    public void testSynapse501() throws Exception {
        ValidateMediatorFactory mf = new ValidateMediatorFactory();
        ValidateMediator validate = (ValidateMediator)mf.createMediator(
                OMXMLBuilderFactory.createOMBuilder(ValidateMediatorTest.class.getResourceAsStream("synapse-501-conf.xml")).getDocumentElement(),
                new Properties());
        MessageContext synCtx = new TestMessageContextBuilder()
                .addEntry("validate_schema", ValidateMediatorTest.class.getResource("synapse-501.xsd"))
                .setEnvelope(ValidateMediatorTest.class.getResource("synapse-501-soap.xml")).build();
        test(validate, synCtx, false);
    }
View Full Code Here

        transformMediator.setSource(xpath);

        // set XSLT transformation URL
        setXsltTransformationURL(transformMediator, "xslt-key");

        MessageContext synCtx = new TestMessageContextBuilder().addFileEntry("xslt-key",
                "../../repository/conf/sample/resources/transform/transform_unittest.xslt")
                .setBodyFromString(SOURCE).addTextAroundBody().build();
        transformMediator.mediate(synCtx);

        // validate result
View Full Code Here

TOP

Related Classes of org.apache.synapse.TestMessageContextBuilder

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.