Package org.apache.cocoon.sitemap.node

Examples of org.apache.cocoon.sitemap.node.InvocationResult


    @Around("execution(* org.apache.cocoon.sitemap.node.SerializeNode.invoke(..)) && args(invocation)")
    public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint, Invocation invocation) throws Throwable {
        SerializeNode target = (SerializeNode) proceedingJoinPoint.getTarget();
        String statusCode = invocation.resolveParameter(target.getParameters().get("status-code"));

        InvocationResult invocationResult = (InvocationResult) proceedingJoinPoint.proceed();
        if (invocationResult.isContinued() && statusCode != null) {
            try {
                setStatusCode(Integer.valueOf(statusCode));
            } catch (NumberFormatException nfe) {
                throw new InvalidStatusCodeException("The status-code '" + statusCode + " is not valid number.", nfe);
            }
View Full Code Here


        }

        for (ProfilingData invocation : element.getInvocations()) {
            if (invocation.getMethod().equals("invoke")) {
                InstanceRepresentation returnValue = invocation.getReturnValue();
                InvocationResult result = InvocationResult.valueOf(returnValue.getStringRepresentation());
                return result == InvocationResult.COMPLETED || result == InvocationResult.CONTINUE;
            }
        }

        return true;
View Full Code Here

    private SitemapBuilder sitemapBuilder;
    private ComponentProvider componentProvider;

    public void testController() throws Exception {
        Invocation invocation = this.buildInvocation("controller/invoke");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
        assertTrue(invocationResult.isCompleted());
    }
View Full Code Here

    public void testGenerator() throws Exception {
        Invocation invocation = this.buildInvocation("sax-pipeline/unauthorized");
        MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
        HttpContextHelper.storeResponse(mockHttpServletResponse, invocation.getParameters());

        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
        assertSame(InvocationResult.COMPLETED, invocationResult);

        // invocation should not be marked as error-invocation
        assertFalse(invocation.isErrorInvocation());
View Full Code Here

        assertEquals(401, ResponseHeaderCollector.getStatusCode());
    }

    public void testNoMatchingPipeline() throws Exception {
        Invocation invocation = this.buildInvocation("unknown");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);

        assertNotNull(invocationResult);
        assertTrue(invocation.isErrorInvocation());
        assertTrue("Expected NoMatchingPipelineException but received " + invocation.getThrowable(), invocation
                .getThrowable() instanceof NoMatchingPipelineException);
View Full Code Here

        assertTrue(response.hasRedirected());
    }

    public void testXSLT() throws Exception {
        Invocation invocation = this.buildInvocation("xslt/main");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
    }
View Full Code Here

    public void testGenerator() throws Exception {
        Invocation invocation = this.buildInvocation("sax-pipeline/unauthorized");
        MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
        HttpContextHelper.storeResponse(mockHttpServletResponse, invocation.getParameters());

        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
        assertSame(InvocationResult.COMPLETED, invocationResult);

        // invocation should not be marked as error-invocation
        assertFalse(invocation.isErrorInvocation());
View Full Code Here

        assertEquals(401, ResponseHeaderCollector.getStatusCode());
    }

    public void testNoMatchingPipeline() throws Exception {
        Invocation invocation = this.buildInvocation("unknown");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);

        assertNotNull(invocationResult);
        assertTrue(invocation.isErrorInvocation());
        assertTrue("Expected NoMatchingPipelineException but received " + invocation.getThrowable(), invocation
                .getThrowable() instanceof NoMatchingPipelineException);
View Full Code Here

                .getThrowable() instanceof NoMatchingPipelineException);
    }

    public void testController() throws Exception {
        Invocation invocation = this.buildInvocation("controller/invoke");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
        assertTrue(invocationResult.isCompleted());
    }
View Full Code Here

        assertTrue(invocationResult.isCompleted());
    }

    public void testXSLT() throws Exception {
        Invocation invocation = this.buildInvocation("xslt/main");
        InvocationResult invocationResult = this.sitemap.invoke(invocation);
        assertNotNull(invocationResult);
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sitemap.node.InvocationResult

Copyright © 2018 www.massapicom. 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.