Search in sources :

Example 1 with RegexTool

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

the class LiveTableResultsTest method setUp.

@Before
@SuppressWarnings("deprecation")
public void setUp() throws Exception {
    setOutputSyntax(Syntax.PLAIN_1_0);
    request.put("outputSyntax", "plain");
    request.put("xpage", "plain");
    oldcore.getXWikiContext().setAction("get");
    queryService = mock(QueryManagerScriptService.class);
    oldcore.getMocker().registerComponent(ScriptService.class, "query", queryService);
    modelService = mock(ModelScriptService.class);
    oldcore.getMocker().registerComponent(ScriptService.class, "model", modelService);
    TagPluginApi tagPluginApi = mock(TagPluginApi.class);
    doReturn(tagPluginApi).when(oldcore.getSpyXWiki()).getPluginApi(eq("tag"), any(XWikiContext.class));
    registerVelocityTool("stringtool", new StringUtils());
    registerVelocityTool("mathtool", new MathTool());
    registerVelocityTool("regextool", new RegexTool());
    registerVelocityTool("numbertool", new NumberTool());
    loadPage(new DocumentReference("xwiki", "XWiki", "LiveTableResultsMacros"));
}
Also used : NumberTool(org.apache.velocity.tools.generic.NumberTool) QueryManagerScriptService(org.xwiki.query.script.QueryManagerScriptService) StringUtils(org.apache.commons.lang3.StringUtils) XWikiContext(com.xpn.xwiki.XWikiContext) TagPluginApi(com.xpn.xwiki.plugin.tag.TagPluginApi) MathTool(org.apache.velocity.tools.generic.MathTool) ModelScriptService(org.xwiki.model.script.ModelScriptService) DocumentReference(org.xwiki.model.reference.DocumentReference) RegexTool(org.xwiki.velocity.tools.RegexTool) Before(org.junit.Before)

Aggregations

XWikiContext (com.xpn.xwiki.XWikiContext)1 TagPluginApi (com.xpn.xwiki.plugin.tag.TagPluginApi)1 StringUtils (org.apache.commons.lang3.StringUtils)1 MathTool (org.apache.velocity.tools.generic.MathTool)1 NumberTool (org.apache.velocity.tools.generic.NumberTool)1 Before (org.junit.Before)1 DocumentReference (org.xwiki.model.reference.DocumentReference)1 ModelScriptService (org.xwiki.model.script.ModelScriptService)1 QueryManagerScriptService (org.xwiki.query.script.QueryManagerScriptService)1 RegexTool (org.xwiki.velocity.tools.RegexTool)1