Package org.pirkaengine.core

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


    public void render_prkDefJavaScript_average() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "PrkDefJavaScript_average";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        Integer[] scores = {10, 8, 9, 10, 8};
        viewModel.put("scores", scores);
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
   
    @Test
    public void render_prkDefGroovy_trim() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
View Full Code Here


        String templateName = "PrkDefGroovy_trim";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text1", "あいうえおかきくけ");
        viewModel.put("text2", "あいうえおかきくけこ");
        viewModel.put("text3", "あいうえおかきくけこさし");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

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

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

     */
    @Test
    public void render_ExternalReference() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "ExternalReference";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate().render();
        assertRenderEquals(templateName, actual);
    }
}
View Full Code Here

    @Test
    public void render_prk_replace() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "Replace";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "置換テキスト");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    /**
     * タグ版
 
View Full Code Here

    @Test
    public void render_prk_replace_tag() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ReplaceTag";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "置換テキスト");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    /**
     * タグ版
 
View Full Code Here

    @Test(expected = ParseException.class)
    public void render_prk_replace_tag_no_value() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ReplaceTagNoValue";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "置換テキスト");
        tmpl.generate(viewModel).render();
    }

    /**
     * 空タグ
     * @throws ParseException
View Full Code Here

    @Test
    public void render_prk_replace_empty_tag() throws ParseException, PirkaLoadException, TemplateNotFoundException {
        String templateName = "ReplaceEmptyTag";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "テキスト");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
}
View Full Code Here

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

    @Test
    public void render_HtmlEscape() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "HtmlEscape";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("entry_text", "<b>強調</b>されます。");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    @Test
    public void render_NoHtmlEscape() 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.