Examples of ASTblock


Examples of org.apache.jsieve.parser.generated.ASTblock

        subject.end(node);
    }

    public void testEndASTblock() throws Exception {
        mock.expects(once()).method("endBlock");
        subject.end(new ASTblock(SieveParserTreeConstants.JJTBLOCK));
    }
View Full Code Here

Examples of org.apache.jsieve.parser.generated.ASTblock

        subject.start(node);
    }

    public void testStartASTblock() throws Exception {
        mock.expects(once()).method("startBlock");
        subject.start(new ASTblock(SieveParserTreeConstants.JJTBLOCK));
    }
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

     * @throws IOException If something goes wrong.
     */
    @Test
    public void testEvaluateWriter() throws IOException {
        InternalContextAdapter internalContextAdapter = createMock(InternalContextAdapter.class);
        ASTBlock body = createMock(ASTBlock.class);
        Writer writer = createMock(Writer.class);
        expect(body.render(internalContextAdapter, writer)).andReturn(true);

        replay(internalContextAdapter, body, writer);
        VelocityModelBody modelBody = createMockBuilder(VelocityModelBody.class)
                .withConstructor(internalContextAdapter, body, writer)
                .createMock();
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

    @Test
    public void testCreateModelBody() {
        InternalContextAdapter context = createMock(InternalContextAdapter.class);
        Writer writer = createMock(Writer.class);
        Node node = createMock(Node.class);
        ASTBlock block = createMock(ASTBlock.class);
        expect(node.jjtGetChild(1)).andReturn(block);
        replay(context, writer, node, block);
        VelocityAutotagRuntime runtime = new VelocityAutotagRuntime();
        runtime.render(context, writer, node);
        ModelBody modelBody = runtime.createModelBody();
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

    }

    /** {@inheritDoc} */
    @Override
    public ModelBody createModelBody() {
        ASTBlock block = (ASTBlock) node.jjtGetChild(1);
        return new VelocityModelBody(context, block, writer);
    }
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

     * @throws IOException If something goes wrong.
     */
    @Test
    public void testEvaluateWriter() throws IOException {
        InternalContextAdapter internalContextAdapter = createMock(InternalContextAdapter.class);
        ASTBlock body = createMock(ASTBlock.class);
        Writer writer = createMock(Writer.class);
        expect(body.render(internalContextAdapter, writer)).andReturn(true);

        replay(internalContextAdapter, body, writer);
        VelocityModelBody modelBody = createMockBuilder(VelocityModelBody.class)
                .withConstructor(internalContextAdapter, body, writer)
                .createMock();
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

        ViewToolContext viewContext = createMock(ViewToolContext.class);
        HttpServletRequest request = createMock(HttpServletRequest.class);
        HttpServletResponse response = createMock(HttpServletResponse.class);
        ServletContext servletContext = createMock(ServletContext.class);
        ASTMap astMap = createMock(ASTMap.class);
        ASTBlock block = createMock(ASTBlock.class);
        Map<String, Object> params = createMock(Map.class);

        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);
        directive.end(context, writer, params, request, response, servletContext);

        replay(directive, context, writer, node, viewContext, servletContext, request, response, astMap, params, block);
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

        ViewToolContext viewContext = createMock(ViewToolContext.class);
        HttpServletRequest request = createMock(HttpServletRequest.class);
        HttpServletResponse response = createMock(HttpServletResponse.class);
        ServletContext servletContext = createMock(ServletContext.class);
        ASTMap astMap = createMock(ASTMap.class);
        ASTBlock block = createMock(ASTBlock.class);
        Map<String, Object> params = createMock(Map.class);

        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);
        directive.end(context, writer, params, null, request, response, servletContext);

        replay(directive, context, writer, node, viewContext, servletContext, request, response, astMap, params, block);
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

     */
    @Test
    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));
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

    @Test
    public void testEvaluateBody() throws IOException {
        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);
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.