Package yalp.templates

Examples of yalp.templates.GroovyTemplateCompiler


    @Test
    public void testDynamicClassBindingWithNew() {
        final String source = "${ new TemplateClassBindingTest.StaticInnerClass().val }";
        GroovyTemplate groovyTemplate = new GroovyTemplate("dynamic_class_binding_with_new", source);
        new GroovyTemplateCompiler().compile(groovyTemplate);
        assertEquals("42", groovyTemplate.render());
    }
View Full Code Here


    @Test
    public void testDynamicClassBindingWithInstanceOf() {
        StaticInnerClass staticInnerClass = new StaticInnerClass();
        final String source = "${ staticInnerClass instanceof TemplateClassBindingTest.StaticInnerClass }";
        GroovyTemplate groovyTemplate = new GroovyTemplate("dynamic_class_binding_with_instanceof", source);
        new GroovyTemplateCompiler().compile(groovyTemplate);
        Map<String, Object> args = new HashMap<String,Object>();
        args.put("staticInnerClass", staticInnerClass);
        assertEquals("true", groovyTemplate.render(args));
    }
View Full Code Here

    @Test
    public void testDynamicClassBindingWithDotClass() {
        StaticInnerClass staticInnerClass = new StaticInnerClass();
        final String source = "${ staticInnerClass.getClass() == TemplateClassBindingTest.StaticInnerClass.class }";
        GroovyTemplate groovyTemplate = new GroovyTemplate("dynamic_class_binding_with_dot_class", source);
        new GroovyTemplateCompiler().compile(groovyTemplate);
        Map<String, Object> args = new HashMap<String,Object>();
        args.put("staticInnerClass", staticInnerClass);
        assertEquals("true", groovyTemplate.render(args));
    }
View Full Code Here

TOP

Related Classes of yalp.templates.GroovyTemplateCompiler

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.