Package org.pirkaengine.core

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


        String templateName = "Method";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        Item item = new Item();
        item.price = 98000;
        viewModel.put("item", item);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
}
View Full Code Here


    @Test
    public void render_prk_wrap_true() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "Wrap";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("is_new", true);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName + "True", actual);
    }

    /**
     * 偽の時、外側のタグがレンダリングされない
 
View Full Code Here

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

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

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

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

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

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

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

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

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

    @Test
    public void render_ConditionEmptyTrue_List() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ConditionEmptyTrue";
        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_ConditionEmptyFalse_List() throws ParseException, PirkaLoadException, TemplateNotFoundException {
View Full Code Here

        String templateName = "ConditionEmptyFalse";
        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_ConditionEmptyTrue_Array() throws ParseException, PirkaLoadException, TemplateNotFoundException {
View Full Code Here

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

    @Test
    public void render_ConditionEmptyFalse_Array() throws ParseException, PirkaLoadException, TemplateNotFoundException {
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.