Package org.pirkaengine.core

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


    @Test
    public void render_Extends_loop() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.loop";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("items", new String[] { "Apple", "Orange", "Pine" });
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    /**
     * 一部、オーバーライドされないケース
 
View Full Code Here


     */
    @Test
    public void render_Extends_default() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.default";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        String actual = tmpl.generate().render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * prk:includeを含むケース
 
View Full Code Here

    @Test
    public void render_Extends_include() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.include";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("text", "XML Template Engine");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }
   
    /**
     * if属性のある場合
 
View Full Code Here

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

    /**
     * for属性のある場合
 
View Full Code Here

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


    /**
 
View Full Code Here

    public void render_Extends_if_for() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.if_for";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("flg", true);
        viewModel.put("items", new String[] {"Hello", "World"} );
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }


    /**
 
View Full Code Here

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

    /**
     * attr属性のある場合
 
View Full Code Here

    @Test
    public void render_Extends_attr() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "Extends.attr";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("style", "news");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

    /**
     * 空要素のある場合
 
View Full Code Here

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

    @Test
    public void render_prkDefGroovy_getFileType() throws ParseException, PirkaLoadException, TemplateNotFoundException  {
        String templateName = "PrkDefGroovy_getFileType";
        Template tmpl = loader.load(getTemplateFileName(templateName));
        viewModel.put("name", "Sample.doc");
        String actual = tmpl.generate(viewModel).render();
        assertRenderEquals(templateName, actual);
    }

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