* Tests {@link VelocityRenderer#render(String, org.apache.tiles.request.Request)}.
* @throws IOException If something goes wrong.
*/
@Test
public void testRender() throws IOException {
VelocityView view = createMock(VelocityView.class);
ServletRequest request = createMock(ServletRequest.class);
HttpServletRequest httpRequest = createMock(HttpServletRequest.class);
HttpServletResponse response = createMock(HttpServletResponse.class);
ViewToolContext context = createMock(ViewToolContext.class);
Template template = createMock(Template.class);
Writer writer = createMock(Writer.class);
expect(request.getRequest()).andReturn(httpRequest);
expect(request.getResponse()).andReturn(response);
expect(view.createContext(httpRequest, response)).andReturn(context);
expect(view.getTemplate("/test.vm")).andReturn(template);
expect(request.getWriter()).andReturn(writer);
view.merge(template, context, writer);
replay(view, request, httpRequest, response, context, template, writer);
Renderer renderer = new VelocityRenderer(view);
renderer.render("/test.vm", request);
verify(view, request, httpRequest, response, context, template, writer);