Package com.alibaba.citrus.service.template

Examples of com.alibaba.citrus.service.template.TemplateContext.containsKey()


        assertThat(content, containsString("6. %3Cworld+name%3D%22'%D6%D0%B9%FA'%22+%2F%3E"));

        // sql
        assertThat(content, containsString("7. <world name=\"''中国''\" />"));

        assertFalse(ctx.containsKey("_ESCAPE_SUPPORT_TYPE_"));
    }

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


        assertThat(content, containsString("7. %3Cworld+name%3D%22'%D6%D0%B9%FA'%22+%2F%3E"));

        // sql
        assertThat(content, containsString("8. <world name=\"''中国''\" />"));

        assertFalse(ctx.containsKey("_ESCAPE_SUPPORT_TYPE_"));
    }

    @Test
    public void escape_with_rules() throws Exception {
        escape_with_rules_internal(factory);
View Full Code Here

        assertThat(content, containsString("8. &lt;world name=&quot;中国&quot; /&gt;"));

        // original (restored)
        assertThat(content, containsString("9. <world name=\"中国\" />"));

        assertFalse(ctx.containsKey("_ESCAPE_SUPPORT_TYPE_"));
    }

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

        assertThat(content, containsString("8. &lt;world name=&quot;中国&quot; /&gt;"));

        // original (restored) - default html
        assertThat(content, containsString("9. &lt;world name=&quot;中国&quot; /&gt;"));

        assertFalse(ctx.containsKey("_ESCAPE_SUPPORT_TYPE_"));
    }

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

        TemplateContext ctx = new MappedTemplateContext();

        String content = templateService.getText("test_local_context.vm", ctx);

        assertThat(content, containsString("hello"));
        assertTrue(ctx.containsKey("varInContext")); // 模板中设置的变量会保留在context中
    }

    @Test
    public void render_set_null() throws Exception {
        getEngine("nostrict", factory);
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.