Package org.impalaframework.web.servlet

Examples of org.impalaframework.web.servlet.ModuleHttpServletRequest


        if (request instanceof ModuleHttpServletRequest) {
            //deal with forwards or includes
            final RequestModuleMapping requestModuleMapping = (RequestModuleMapping) request.getAttribute(EXISTING_REQUEST_MODULE_MAPPING);
            if (requestModuleMapping != null) {
                if (!useExternalForwardingOrIncludes(request)) {
                    ModuleHttpServletRequest moduleRequest = (ModuleHttpServletRequest) request;
                    moduleRequest.setReuse();
                    return requestModuleMapping;
                }
            }  
        }
       
View Full Code Here


        assertNull(mapper.getModuleForURI("/m3"));
    }
   
    public void testExistingRequest() throws Exception {
       
        final ModuleHttpServletRequest request = createMock(ModuleHttpServletRequest.class);

        expect(request.getRequestURI()).andReturn("/context/servlet/path");
        expect(request.getContextPath()).andReturn("/context");
        final RequestModuleMapping mapping = new RequestModuleMapping("/context/servlet/path", "module", "/context", "/servlet");
        expect(request.getAttribute(UrlPrefixRequestModuleMapper.EXISTING_REQUEST_MODULE_MAPPING)).andReturn(mapping);
        expect(request.getAttribute(ModuleIntegrationUtils.EXTERNAL_REQUEST_INCLUDES_OR_FORWARDS)).andReturn("false");
        expect(request.setReuse()).andReturn(true);
       
        replay(request);
        assertSame(mapping, mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here

        verify(request);
    }
   
    public void testExternalForwarding() throws Exception {
       
        final ModuleHttpServletRequest request = createMock(ModuleHttpServletRequest.class);

        expect(request.getRequestURI()).andReturn("/context/servlet/path");
        expect(request.getContextPath()).andReturn("/context");
        final RequestModuleMapping mapping = new RequestModuleMapping("/context/servlet/path", "module", "/context", "/servlet");
        expect(request.getAttribute(UrlPrefixRequestModuleMapper.EXISTING_REQUEST_MODULE_MAPPING)).andReturn(mapping);
        expect(request.getAttribute(ModuleIntegrationUtils.EXTERNAL_REQUEST_INCLUDES_OR_FORWARDS)).andReturn(true);
       
        replay(request);
        assertNull(mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here

        verify(request);
    }
   
    public void testNotModuleMapper() throws Exception {
       
        final ModuleHttpServletRequest request = createMock(ModuleHttpServletRequest.class);

        expect(request.getRequestURI()).andReturn("/context/servlet/path");
        expect(request.getContextPath()).andReturn("/context");
        expect(request.getAttribute(UrlPrefixRequestModuleMapper.EXISTING_REQUEST_MODULE_MAPPING)).andReturn(null);
       
        replay(request);
        assertNull(mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here

        verify(webAttributeQualifier, servletContext, request);
    }
   
    public void testReuseModuleWrapper() {
        PartitionedRequestWrapper factory = new PartitionedRequestWrapper();
        final ModuleHttpServletRequest request = EasyMock.createMock(ModuleHttpServletRequest.class);
        expect(request.isReuse()).andReturn(true);
       
        replay(request);
       
        assertSame(request, factory.getWrappedRequest(request, servletContext, moduleMapping, applicationId));
       
View Full Code Here

    }
   
    public void testNotReuseModuleWrapper() {
        PartitionedRequestWrapper factory = new PartitionedRequestWrapper();
        factory.setWebAttributeQualifier(webAttributeQualifier);
        final ModuleHttpServletRequest request = EasyMock.createMock(ModuleHttpServletRequest.class);
        expect(request.isReuse()).andReturn(false);
       
        expectWrappedRequest(request);
       
        replay(request, webAttributeQualifier);
       
View Full Code Here

TOP

Related Classes of org.impalaframework.web.servlet.ModuleHttpServletRequest

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.