Package org.pirkaengine.core.template

Examples of org.pirkaengine.core.template.XhtmlTemplate


     */
    @Test
    public void create_public_field() throws ModelDeficientPropertyException {
       
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> model = new HashMap<String, Object>();
                model.put("name", new Object());
                return model;
View Full Code Here


     */
    @Test
    public void create_getter() throws ModelDeficientPropertyException {
       
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> model = new HashMap<String, Object>();
                model.put("name", new Object());
                return model;
View Full Code Here

     */
    @Test
    public void create_method() throws ModelDeficientPropertyException {
       
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> model = new HashMap<String, Object>();
                model.put("name", new Object());
                return model;
View Full Code Here

     */
    @Test
    public void create_composite() throws ModelDeficientPropertyException {
       
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> model = new HashMap<String, Object>();
                model.put("name", new Object());
                model.put("price", new Object());
View Full Code Here

     */
    @Test
    public void create_nest() throws ModelDeficientPropertyException {
       
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> nest = new HashMap<String, Object>();
                nest.put("name", new Object());
                HashMap<String, Object> model = new HashMap<String, Object>();
View Full Code Here

     * @throws ModelDeficientPropertyException
     */
    @Test(expected = ModelDeficientPropertyException.class)
    public void create_no_property() throws ModelDeficientPropertyException {
        @SuppressWarnings("serial")
        Template template = new XhtmlTemplate("test") {
            @Override
            public Map<String, Object> createViewModel() {
                HashMap<String, Object> model = new HashMap<String, Object>();
                model.put("name", new Object());
                return model;
View Full Code Here

*/
public class XhtmlTemplateTest {

    @Test
    public void createViewModel_simple() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo"));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("foo", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

        Assert.assertEquals(expected, template.createViewModel());
    }

    @Test
    public void createViewModel_2_expressions() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo"));
        template.stack(new ExpressionNode("bar"));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("foo", XhtmlTemplate.NULL_VALUE);
        expected.put("bar", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

        Assert.assertEquals(expected, template.createViewModel());
    }

    @Test
    public void createViewModel_nest_case() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo.bar"));
        Map<String, Object> expected = new HashMap<String, Object>();
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
        expected.put("foo", foo);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

        Assert.assertEquals(expected, template.createViewModel());
    }

    @Test
    public void createViewModel_composite_case() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));
        Map<String, Object> expected = new HashMap<String, Object>();
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
        expected.put("foo", foo);
        expected.put("poo", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

TOP

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

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.