Package org.pirkaengine.core

Examples of org.pirkaengine.core.Template.generate()


        String templateName = "ConditionEmptyFalse";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("items", new String[] {
            "Item"
        });
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_ConditionNotEmptyTrue_List() throws ParseException, PirkaLoadException,
View Full Code Here


        String templateName = "ConditionNotEmptyTrue";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        ArrayList<String> list = new ArrayList<String>();
        list.add("Item");
        viewModel.put("items", list);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_ConditionNotEmptyFalse_List() throws ParseException, PirkaLoadException,
View Full Code Here

    public void render_ConditionNotEmptyFalse_List() throws ParseException, PirkaLoadException,
            TemplateNotFoundException {
        String templateName = "ConditionNotEmptyFalse";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("items", new ArrayList<String>());
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_ConditionNotEmptyTrue_Array() throws ParseException, PirkaLoadException,
View Full Code Here

        String templateName = "ConditionNotEmptyTrue";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("items", new String[] {
            "Item"
        });
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_ConditionNotEmptyFalse_Array() throws ParseException, PirkaLoadException,
View Full Code Here

    public void render_ConditionNotEmptyFalse_Array() throws ParseException, PirkaLoadException,
            TemplateNotFoundException {
        String templateName = "ConditionNotEmptyFalse";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("items", new String[0]);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    /**
     * ネスとしたprk:if テスト
View Full Code Here

    public void render_ConditionNest() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ConditionNest";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("display", true);
        viewModel.put("title", "レンダリングテスト");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_ConditionWithCDATA() throws ParseException, PirkaLoadException, TemplateNotFoundException {
View Full Code Here

    @Test
    public void render_ConditionWithCDATA() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ConditionWithCDATA";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("display", true);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

}
View Full Code Here

     */
    @Test
    public void render_Extends() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate().render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * prk:contentの場合
 
View Full Code Here

    @Test
    public void render_Extends_content() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.content";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("message", "Hello Pirka");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * 評価式の場合
 
View Full Code Here

    @Test
    public void render_Extends_expression() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.expression";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("value", 2010);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * ループのあるケース
 
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.