Search in sources :

Example 1 with VelocityContextFactory

use of org.xwiki.velocity.VelocityContextFactory in project xwiki-platform by xwiki.

the class VelocityContextInitializerTest method testVelocityBridges.

/**
 * Test the presence of velocity bridges.
 *
 * @throws Exception
 */
@Test
public void testVelocityBridges() throws Exception {
    // Make sure the execution context is not null when velocity bridges are initialized.
    getComponentManager().<Execution>getInstance(Execution.class).setContext(new ExecutionContext());
    VelocityContextFactory factory = getComponentManager().getInstance(VelocityContextFactory.class);
    VelocityContext context = factory.createContext();
    Assert.assertNotNull(context.get("officeimporter"));
    Assert.assertNotNull(context.get("ooconfig"));
    Assert.assertNotNull(context.get("oomanager"));
}
Also used : Execution(org.xwiki.context.Execution) ExecutionContext(org.xwiki.context.ExecutionContext) VelocityContextFactory(org.xwiki.velocity.VelocityContextFactory) VelocityContext(org.apache.velocity.VelocityContext) Test(org.junit.Test)

Aggregations

VelocityContext (org.apache.velocity.VelocityContext)1 Test (org.junit.Test)1 Execution (org.xwiki.context.Execution)1 ExecutionContext (org.xwiki.context.ExecutionContext)1 VelocityContextFactory (org.xwiki.velocity.VelocityContextFactory)1