Search in sources :

Example 1 with TestPluginNode

use of org.mvel2.tests.templates.tests.res.TestPluginNode in project mvel by mvel.

the class TemplateTests method testPluginNode.

public void testPluginNode() {
    Map<String, Class<? extends org.mvel2.templates.res.Node>> plugins = new HashMap<String, Class<? extends org.mvel2.templates.res.Node>>();
    plugins.put("testNode", TestPluginNode.class);
    TemplateCompiler compiler = new TemplateCompiler("Foo:@testNode{}!!", plugins);
    CompiledTemplate compiled = compiler.compile();
    assertEquals("Foo:THIS_IS_A_TEST!!", TemplateRuntime.execute(compiled));
}
Also used : TestPluginNode(org.mvel2.tests.templates.tests.res.TestPluginNode) TemplateCompiler(org.mvel2.templates.TemplateCompiler) CompiledTemplate(org.mvel2.templates.CompiledTemplate)

Example 2 with TestPluginNode

use of org.mvel2.tests.templates.tests.res.TestPluginNode in project mvel by mikebrock.

the class TemplateTests method testPluginNode.

public void testPluginNode() {
    Map<String, Class<? extends Node>> plugins = new HashMap<String, Class<? extends Node>>();
    plugins.put("testNode", TestPluginNode.class);
    TemplateCompiler compiler = new TemplateCompiler("Foo:@testNode{}!!", plugins);
    CompiledTemplate compiled = compiler.compile();
    assertEquals("Foo:THIS_IS_A_TEST!!", TemplateRuntime.execute(compiled));
}
Also used : Node(org.mvel2.templates.res.Node) TestPluginNode(org.mvel2.tests.templates.tests.res.TestPluginNode) TemplateCompiler(org.mvel2.templates.TemplateCompiler) CompiledTemplate(org.mvel2.templates.CompiledTemplate)

Aggregations

CompiledTemplate (org.mvel2.templates.CompiledTemplate)2 TemplateCompiler (org.mvel2.templates.TemplateCompiler)2 TestPluginNode (org.mvel2.tests.templates.tests.res.TestPluginNode)2 Node (org.mvel2.templates.res.Node)1