Search in sources :

Example 21 with VelocityEngine

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

the class WikiUIExtensionParametersTest method setUp.

@Before
public void setUp() throws Exception {
    VelocityManager velocityManager = componentManager.registerMockComponent(VelocityManager.class);
    execution = componentManager.registerMockComponent(Execution.class);
    modelContext = componentManager.registerMockComponent(ModelContext.class);
    velocityEngine = mock(VelocityEngine.class);
    velocityContext = new VelocityContext();
    ExecutionContext executionContext = mock(ExecutionContext.class);
    when(execution.getContext()).thenReturn(executionContext);
    when(velocityManager.getVelocityContext()).thenReturn(velocityContext);
    when(velocityManager.getVelocityEngine()).thenReturn(velocityEngine);
}
Also used : ModelContext(org.xwiki.model.ModelContext) VelocityEngine(org.xwiki.velocity.VelocityEngine) Execution(org.xwiki.context.Execution) ExecutionContext(org.xwiki.context.ExecutionContext) VelocityManager(org.xwiki.velocity.VelocityManager) VelocityContext(org.apache.velocity.VelocityContext) Before(org.junit.Before)

Aggregations

VelocityEngine (org.xwiki.velocity.VelocityEngine)21 VelocityContext (org.apache.velocity.VelocityContext)18 VelocityManager (org.xwiki.velocity.VelocityManager)14 Test (org.junit.Test)11 Reader (java.io.Reader)6 StringWriter (java.io.StringWriter)6 Writer (java.io.Writer)6 Properties (java.util.Properties)5 DocumentAccessBridge (org.xwiki.bridge.DocumentAccessBridge)5 DocumentReference (org.xwiki.model.reference.DocumentReference)5 Map (java.util.Map)4 XWikiVelocityException (org.xwiki.velocity.XWikiVelocityException)4 HashMap (java.util.HashMap)3 Expectations (org.jmock.Expectations)3 Invocation (org.jmock.api.Invocation)3 Execution (org.xwiki.context.Execution)3 BaseObject (com.xpn.xwiki.objects.BaseObject)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 StringReader (java.io.StringReader)2 Description (org.hamcrest.Description)2