Package org.apache.synapse

Examples of org.apache.synapse.TestMessageContextBuilder


        // set the schema url, source xpath and any name spaces
        validate.setSchemaKeys(Collections.singletonList("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(Arrays.asList("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(Arrays.asList("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(Collections.singletonList("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(Collections.singletonList("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(Collections.singletonList("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(Collections.singletonList("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

        transformMediator.setSource(xpath);

        // set XSLT transformation URL
        transformMediator.setXsltKey("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

        XSLTMediator transformMediator = new XSLTMediator();

        // set XSLT transformation URL
        transformMediator.setXsltKey("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

        transformMediator.setXsltKey("xslt-key");

        for (int i=0; i<2; i++) {

            // invoke transformation, with static enveope
            MessageContext synCtx = new TestMessageContextBuilder().addFileEntry("xslt-key",
                    "../../repository/conf/sample/resources/transform/transform_load.xml")
                    .setBodyFromFile("../../repository/conf/sample/resources/transform/message.xml")
                    .addTextAroundBody().build();
            //MessageContext synCtx = TestUtils.getTestContextForXSLTMediator(SOURCE, props);
            transformMediator.mediate(synCtx);
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.