Package org.pirkaengine.core

Examples of org.pirkaengine.core.Template


public class RenderTest_context extends RenderTest {

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


public class RenderTest_DocType extends RenderTest {

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

    @Test
    public void render_Sample_ItemList() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        this.setupViewModel();
        String templateName = "Sample_ItemList";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
View Full Code Here

    @Test
    public void render_Sample_ItemListCR() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        this.setupViewModel();
        String templateName = "Sample_ItemListCR";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
View Full Code Here

   
    @Test
    public void render_Sample_ItemListLF() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        this.setupViewModel();
        String templateName = "Sample_ItemListLF";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
View Full Code Here

    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

public class RenderTest_functions extends RenderTest {

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

    }

    @Test
    public void render_PrkFunctions_format() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "PrkFunctions_format";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        Item item = new Item();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2010);
        cal.set(Calendar.MONTH, 3);
        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);
    }
View Full Code Here

    }

    @Test
    public void render_PrkFunctions_formatName() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "PrkFunctions_formatName";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        Item item = new Item();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2010);
        cal.set(Calendar.MONTH, 3);
        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);
    }
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);
    }
View Full Code Here

TOP

Related Classes of org.pirkaengine.core.Template

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.