Search in sources :

Example 1 with EscapeTool

use of org.xwiki.velocity.tools.EscapeTool in project xwiki-platform by xwiki.

the class MacrosTest method setup.

@Before
public void setup() {
    this.ve = new VelocityEngine();
    Properties props = new Properties();
    String path = String.format("%s/src/main/webapp/templates", BASEDIR);
    props.setProperty("file.resource.loader.path", path);
    props.setProperty("directive.set.null.allowed", "true");
    props.setProperty("velocimacro.permissions.allow.inline.local.scope", "true");
    props.setProperty("velocimacro.library", "macros.vm");
    this.ve.init(props);
    this.context = new VelocityContext();
    this.context.put("escapetool", new EscapeTool());
}
Also used : VelocityEngine(org.apache.velocity.app.VelocityEngine) VelocityContext(org.apache.velocity.VelocityContext) EscapeTool(org.xwiki.velocity.tools.EscapeTool) Properties(java.util.Properties) Before(org.junit.Before)

Aggregations

Properties (java.util.Properties)1 VelocityContext (org.apache.velocity.VelocityContext)1 VelocityEngine (org.apache.velocity.app.VelocityEngine)1 Before (org.junit.Before)1 EscapeTool (org.xwiki.velocity.tools.EscapeTool)1