Package org.pirkaengine.core

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


        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.HOUR_OF_DAY, 12);
        cal.set(Calendar.MINUTE, 30);
        item.date = cal.getTime();
        viewModel.put("x", item);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

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


        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.HOUR_OF_DAY, 12);
        cal.set(Calendar.MINUTE, 30);
        item.date = cal.getTime();
        viewModel.put("x", item);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

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

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

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

    @Test
    public void render_PrkFunctions_cond_false() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "PrkFunctions_cond_false";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("flg", false);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
}
View Full Code Here

    @Test
    public void render_include() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "Include";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "Hello World");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

}
View Full Code Here

    @Test
    public void render_no_DocType() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "NoDocType";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "置換されました。");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

}
View Full Code Here

    public void render_CompositeConditionAndAttr() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "CompositeConditionAndAttr";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("is_login", true);
        viewModel.put("msg_class", "msg");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * ConditionとContentの複合タグテスト
 
View Full Code Here

     */
    @Test
    public void render_prk_path_href() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "Path.href";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate().render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * prk:path はParseException
View Full Code Here

     */
    @Test(expected = ParseException.class)
    public void render_prk_path() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "Path";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        tmpl.generate().render();
    }
}
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.