Package org.pirkaengine.core.template

Examples of org.pirkaengine.core.template.ConditionNode


    @Before
    public void setup() {
        Node[] nodes = new Node[1];
        nodes[0] = new TextNode("text");
        target = new ConditionNode(new StartTagNode("<p>", "prk:if", "display"), new EndTagNode("</p>"), nodes);
    }
View Full Code Here


    @Test(expected = IllegalArgumentException.class)
    public void test_constructor() {
        Node[] nodes = new Node[1];
        nodes[0] = new TextNode("text");
        new ConditionNode(null, new EndTagNode("</p>"), nodes);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void test_constructor2() {
        Node[] nodes = new Node[1];
        nodes[0] = new TextNode("text");
        new ConditionNode(new StartTagNode("<p>", "prk:if", "display"), null, nodes);
    }
View Full Code Here

        new ConditionNode(new StartTagNode("<p>", "prk:if", "display"), null, nodes);
    }

    @Test(expected = IllegalArgumentException.class)
    public void test_constructor3() {
        new ConditionNode(new StartTagNode("<p>", "prk:if", "display"), new EndTagNode("</p>"), null);
    }
View Full Code Here

    @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

    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

TOP

Related Classes of org.pirkaengine.core.template.ConditionNode

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.