Package org.apache.velocity.runtime.parser.node

Examples of org.apache.velocity.runtime.parser.node.Node.jjtGetChild()


        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(request.getSession()).andReturn(session).times(2);
View Full Code Here


        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);
        servletContext.setAttribute("one", "value1");
View Full Code Here

        expect(context.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(context)).andReturn(params);
        expect(node.jjtGetChild(1)).andReturn(block);
        expect(block.render(context, writer)).andReturn(true);

        directive.start(context, writer, params, request, response, servletContext);
View Full Code Here

        expect(viewContext.getRequest()).andReturn(request);
        expect(viewContext.getResponse()).andReturn(response);
        expect(viewContext.getServletContext()).andReturn(servletContext);
        expect(node.jjtGetChild(0)).andReturn(astMap);
        expect(astMap.value(context)).andReturn(params);
        expect(node.jjtGetChild(1)).andReturn(block);
        expect(block.render(context, writer)).andReturn(true);

        directive.start(context, writer, params, request, response, servletContext);
        directive.end(context, writer, params, request, response, servletContext);
View Full Code Here

        expect(context.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(context)).andReturn(params);
        expect(node.jjtGetChild(1)).andReturn(block);
        expect(block.render(eq(context), isA(StringWriter.class))).andReturn(true);

        directive.start(context, writer, params, request, response, servletContext);
View Full Code Here

        expect(viewContext.getRequest()).andReturn(request);
        expect(viewContext.getResponse()).andReturn(response);
        expect(viewContext.getServletContext()).andReturn(servletContext);
        expect(node.jjtGetChild(0)).andReturn(astMap);
        expect(astMap.value(context)).andReturn(params);
        expect(node.jjtGetChild(1)).andReturn(block);
        expect(block.render(eq(context), isA(StringWriter.class))).andReturn(true);

        directive.start(context, writer, params, request, response, servletContext);
        directive.end(context, writer, params, null, request, response, servletContext);
View Full Code Here

    public void testGetBodyAsString() throws IOException {
        InternalContextAdapter context = createMock(InternalContextAdapter.class);
        Node node = createMock(Node.class);
        ASTBlock block = new CustomBlock();

        expect(node.jjtGetChild(1)).andReturn(block);

        replay(context, node);
        assertEquals("myBody", VelocityUtil.getBodyAsString(context, node));
        verify(context, node);
    }
View Full Code Here

        InternalContextAdapter context = createMock(InternalContextAdapter.class);
        Node node = createMock(Node.class);
        Writer writer = createMock(Writer.class);
        ASTBlock block = createMock(ASTBlock.class);

        expect(node.jjtGetChild(1)).andReturn(block);

        replay(context, node, writer);
        VelocityUtil.evaluateBody(context, writer, node);
        verify(context, node, writer);
    }
View Full Code Here

        InternalContextAdapter context = createMock(InternalContextAdapter.class);
        Node node = createMock(Node.class);
        ASTMap block = createMock(ASTMap.class);
        Map<String, Object> params = createMock(Map.class);

        expect(node.jjtGetChild(0)).andReturn(block);
        expect(block.value(context)).andReturn(params);

        replay(context, node, block, params);
        assertEquals(params, VelocityUtil.getParameters(context, node));
        verify(context, node, block, params);
View Full Code Here

            // if this is a "chunk", evaluate its expression and prepend join if included...
            if (child instanceof ASTDirective
                && "chunk".equals(((ASTDirective) child).getDirectiveName())) {

                if (child.jjtGetNumChildren() < 2
                    || child.jjtGetChild(0).value(context) != null) {

                    if (includedChunks > 0) {
                        childWriter.write(join);
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.