Examples of stack()


Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("li", "prk:for", "item in items");
        EndTagNode end = new EndTagNode("li");
        ExpressionNode node1 = new ExpressionNode("item.name");
        ExpressionNode node2 = new ExpressionNode("item.price");
        template.stack(new LoopNode(start, end, new Node[] { node1, node2 }));
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

        StartTagNode start = new StartTagNode("li", "prk:for", "item in items");
        EndTagNode end = new EndTagNode("li");
        ExpressionNode node1 = new ExpressionNode("item.name");
        ExpressionNode node2 = new ExpressionNode("item.price");
        template.stack(new LoopNode(start, end, new Node[] { node1, node2 }));
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
        Map<String, Object> foo = new HashMap<String, Object>();
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

        EndTagNode end = new EndTagNode("li");
        ExpressionNode node1 = new ExpressionNode("item.name");
        ExpressionNode node2 = new ExpressionNode("item.price");
        template.stack(new LoopNode(start, end, new Node[] { node1, node2 }));
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

    @Test
    public void createViewModel_condition() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("div", "prk:if", "cond");
        EndTagNode end = new EndTagNode("div");
        template.stack(new ConditionNode(start, end, new Node[] {}));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("cond", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

    public void createViewModel_condition_with_expression() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("div", "prk:if", "cond");
        EndTagNode end = new EndTagNode("div");
        ExpressionNode node = new ExpressionNode("name");
        template.stack(new ConditionNode(start, end, new Node[] { node }));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("cond", XhtmlTemplate.NULL_VALUE);
        expected.put("name", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

    @Test
    public void createViewModel_repeat() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("span", "prk:repeat", "count");
        EndTagNode end = new EndTagNode("span");
        template.stack(new RepeatNode(start, end, new Node[] {}));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("count", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

Examples of org.pirkaengine.core.template.XhtmlTemplate.stack()

    @Test
    public void serializeAndDeserialize_simple() throws SerializeException {
        String templateName = "simple";
        XhtmlTemplate template = new XhtmlTemplate(templateName);
        template.stack(new TextNode("<html><body></body></html>"));
        target.serialize(template);
        Template result = target.deserialize(template.getName());
        assertEquals(template, result);
    }
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.