Examples of UnsafeCharArrayWriter


Examples of jetbrick.template.utils.UnsafeCharArrayWriter

    @Test
    public void test100() throws Exception {
        String source = "#set(Map<String, String> map = {'name':'jetbrick'})\n";
        source += "${map.name.length()}";
        JetTemplate template = engine.createTemplate(source);
        UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
        template.render(new JetContext(), out);
        Assert.assertEquals("8", out.toString());
    }
View Full Code Here

Examples of jetbrick.template.utils.UnsafeCharArrayWriter

    @Test
    public void test100_2() throws Exception {
        String source = "#set(Map<String, Map<String, String>> map = {'me':{'name':'jetbrick'}})\n";
        source += "${map.me.name.length()}";
        JetTemplate template = engine.createTemplate(source);
        UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
        template.render(new JetContext(), out);
        Assert.assertEquals("8", out.toString());
    }
View Full Code Here

Examples of jetbrick.template.utils.UnsafeCharArrayWriter

    }

    @Test
    public void forEnum() {
        JetTemplate template = engine.createTemplate("#for(item: items)${item}#end");
        UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
        JetContext context = new JetContext();
        context.put("items", MyEnum.class);
        template.render(context, out);
        Assert.assertEquals(out.toString(), "aabbccdd");
    }
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.