@Test
public void testExecutePage() {
HttpServletRequest request = createMock(HttpServletRequest.class);
HttpServletResponse response = createMock(HttpServletResponse.class);
ServletContext servletContext = createMock(ServletContext.class);
InternalContextAdapter velocityContext = createMock(InternalContextAdapter.class);
ViewToolContext viewContext = createMock(ViewToolContext.class);
ASTMap astMap = createMock(ASTMap.class);
Node node = createMock(Node.class);
TilesContainer container = createMock(TilesContainer.class);
Writer writer = new StringWriter();
Map<String, Object> params = createParams();
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("one", "value1");
attributes.put("two", "value2");
expect(velocityContext.getInternalUserContext()).andReturn(viewContext);
expect(viewContext.getRequest()).andReturn(request);
expect(viewContext.getResponse()).andReturn(response);
expect(viewContext.getServletContext()).andReturn(servletContext);
expect(node.jjtGetChild(0)).andReturn(astMap);
expect(astMap.value(velocityContext)).andReturn(params);
expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(container);
expect(tModel.getImportedAttributes(container, "myName", "myToName", false,
velocityContext, request, response)).andReturn(attributes);
expect(velocityContext.put("one", "value1")).andReturn("value1");
expect(velocityContext.put("two", "value2")).andReturn("value2");
replay(tModel, servletContext, request, response, velocityContext, container, node, viewContext, astMap);
initializeModel();
model.render(velocityContext, writer, node);
verify(tModel, servletContext, request, response, velocityContext, container, node, viewContext, astMap);