Package com.alibaba.citrus.service.velocity.VelocityEngineTests

Examples of com.alibaba.citrus.service.velocity.VelocityEngineTests.Counter


    @Test
    public void escape_directive() throws Exception {
        getEngine("with_escape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"中国\" />"));

        String content = templateService.getText("escape/test_escape.vm", ctx);

        // original
View Full Code Here


    @Test
    public void escape_directive_default() throws Exception {
        getEngine("with_defaultEscape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"中国\" />"));

        String content = templateService.getText("escape/test_escape.vm", ctx);

        // original - default html
View Full Code Here

    @Test
    public void escape_directive_default_interplate() throws Exception {
        getEngine("with_defaultEscape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"中国\" />"));

        String content = templateService.getText("escape/test_escape_interpolation.vm", ctx);

        assertThat(content, containsString("1. &lt;world name=&quot;中国&quot; /&gt;"));
View Full Code Here

    @Test
    public void escape_directive_parse() throws Exception {
        getEngine("with_escape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"中国\" />"));

        String content = templateService.getText("escape/test_escape_parse.vm", ctx);

        assertThat(content, containsString("1. &lt;world name=&quot;中国&quot; /&gt;"));
View Full Code Here

    @Test
    public void escape_directive_all_types() throws Exception {
        getEngine("with_escape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"'中国'\" />"));

        String content = templateService.getText("escape/test_escape_all_types.vm", ctx);

        // noescape
View Full Code Here

    @Test
    public void escape_directive_macros() throws Exception {
        getEngine("with_escape", factory);

        TemplateContext ctx = new MappedTemplateContext();
        ctx.put("count", new Counter());
        ctx.put("object", new MyRenderable("<world name=\"'中国'\" />"));

        String content = templateService.getText("escape/test_escape_macros.vm", ctx);

        // noescape
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.velocity.VelocityEngineTests.Counter

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.