Package org.apache.synapse.rest.dispatch

Examples of org.apache.synapse.rest.dispatch.URITemplateHelper


    public void testDefaultDispatch() throws Exception {

        API api = new API("TestAPI", "/test");
        Resource resource = new Resource();
        resource.setDispatcherHelper(new URITemplateHelper("/"));
        resource.setInSequence(getTestSequence(PROP_NAME, PROP_VALUE));
        api.addResource(resource);

        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.addAPI(api.getName(), api);
View Full Code Here


    public void testMultipleResourceDispatch() throws Exception {

        API api = new API("TestAPI", "/");
        Resource resource1 = new Resource();
        resource1.setDispatcherHelper(new URITemplateHelper("/dictionary/{char}/{word}"));
        resource1.setInSequence(getTestSequence(PROP_NAME, "r1"));
        api.addResource(resource1);

        Resource resource2 = new Resource();
        resource2.setDispatcherHelper(new URITemplateHelper("/dictionary/{char}"));
        resource2.setInSequence(getTestSequence(PROP_NAME, "r2"));
        api.addResource(resource2);

        Resource resource3 = new Resource();
        resource3.setDispatcherHelper(new URITemplateHelper("/dictionary/{char}{#ref}"));
        resource3.setInSequence(getTestSequence(PROP_NAME, "r3"));
        api.addResource(resource3);

        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.addAPI(api.getName(), api);
View Full Code Here

    }

    public void testFaultSequence() throws Exception {
        API api = new API("TestAPI", "/test");
        Resource resource = new Resource();
        resource.setDispatcherHelper(new URITemplateHelper("/~{user}"));
        SequenceMediator inSequence = getTestSequence("seq.in", "seq.in.value");
        ((PropertyMediator) inSequence.getChild(0)).setScope("axis2");
        XSLTMediator xsltMediator = new XSLTMediator();
        xsltMediator.setXsltKey(new Value("/bogus/key"));
        inSequence.addChild(xsltMediator);
View Full Code Here

        OMAttribute urlMappingAtt = resourceElt.getAttribute(new QName("url-mapping"));
        OMAttribute uriTemplateAtt = resourceElt.getAttribute(new QName("uri-template"));
        if (urlMappingAtt != null && !"".equals(urlMappingAtt.getAttributeValue())) {
            resource.setDispatcherHelper(new URLMappingHelper(urlMappingAtt.getAttributeValue()));
        } else if (uriTemplateAtt != null && !"".equals(uriTemplateAtt.getAttributeValue())) {
            resource.setDispatcherHelper(new URITemplateHelper(uriTemplateAtt.getAttributeValue()));
        }
    }
View Full Code Here

    private static final String PROP_VALUE = "prop.value";

    public void testBasicTemplateDispatch1() throws Exception {
        API api = new API("TestAPI", "/test");
        Resource resource = new Resource();
        resource.setDispatcherHelper(new URITemplateHelper("/~{user}"));
        resource.setInSequence(getTestSequence(PROP_NAME, PROP_VALUE));
        api.addResource(resource);

        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.addAPI(api.getName(), api);
View Full Code Here

    public void testBasicTemplateDispatch2() throws Exception {

        API api = new API("TestAPI", "/");
        Resource resource = new Resource();
        resource.setDispatcherHelper(new URITemplateHelper("/dictionary/{char}/{word}"));
        resource.setInSequence(getTestSequence(PROP_NAME, PROP_VALUE));
        api.addResource(resource);

        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.addAPI(api.getName(), api);
View Full Code Here

TOP

Related Classes of org.apache.synapse.rest.dispatch.URITemplateHelper

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.