Examples of InvokeContext


Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

        String expr = "{request-param:{request-param:foo}}";
        MockRequest request = getRequest();
        request.reset();
        request.addParameter("foo", "bar");
        request.addParameter("bar", "123");
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());
       
        Map sitemapElements = new HashMap();
        context.pushMap("sitemap", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    public void testNestedModuleAndSitemapExpressions() throws Exception {
        String expr = "{request-param:f{1}}";
        MockRequest request = getRequest();
        request.reset();
        request.addParameter("foo", "123");
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());
       
        Map sitemapElements = new HashMap();
        sitemapElements.put("1", "oo");
        context.pushMap("sitemap", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }
   
    public void testAnchors() throws PatternException {
        String expr = "{#label:name}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());
       
        Map sitemapElements = new HashMap();
        sitemapElements.put("name", "123");
        context.pushMap("label", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123", resolver.resolve(context, getObjectModel()));       
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }
   
    public void testSitemapVariables() throws PatternException {
        String expr = "123{1}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements = new HashMap();
        sitemapElements.put("1", "abc");
        context.pushMap("label", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123abc", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }

    public void testSitemapVariablesWithText() throws PatternException {
        String expr = "123{1}/def";
   
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements = new HashMap();
        sitemapElements.put("1", "abc");
        context.pushMap("label", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123abc/def", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }
   
    public void testPrefixedSitemapVariable() throws PatternException {
        String expr = "123{sitemap:1}/def";
   
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements = new HashMap();
        sitemapElements.put("1", "abc");
        context.pushMap("label", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("123abc/def", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }

    public void testMultilevelSitemapVariables() throws PatternException {
        String expr = "from {../1} to {1}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements;
        sitemapElements = new HashMap();
        sitemapElements.put("1", "juliet");
        context.pushMap("label1", sitemapElements);
       
        sitemapElements = new HashMap();
        sitemapElements.put("1", "oscar");
        context.pushMap("label2", sitemapElements);

        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("from juliet to oscar", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }

    public void testRootSitemapVariables() throws PatternException {
        String expr = "from {/1} to {1}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements;
        sitemapElements = new HashMap();
        sitemapElements.put("1", "juliet");
        context.pushMap("label1", sitemapElements);
       
        sitemapElements = new HashMap();
        sitemapElements.put("1", "oscar");
        context.pushMap("label2", sitemapElements);

        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("from juliet to oscar", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }
   
    public void testColonInTextContent() throws PatternException {
        String expr = "http://cocoon.apache.org";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements;
        sitemapElements = new HashMap();
        context.pushMap("label", sitemapElements);
       
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals("http://cocoon.apache.org", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.InvokeContext

    }
   
    public void testColonBeginningTextContent() throws PatternException {
        String expr = ":colon-starts-this";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(getLogger());

        Map sitemapElements;
        sitemapElements = new HashMap();
        context.pushMap("label", sitemapElements);
       
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, getManager());
        assertEquals(":colon-starts-this", resolver.resolve(context, getObjectModel()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.