Package org.impalaframework.web.servlet.wrapper

Examples of org.impalaframework.web.servlet.wrapper.RequestModuleMapping


    protected void doFilter(HttpServletRequest request, HttpServletResponse response,
            ServletContext context, FilterChain chain)
            throws ServletException, IOException {

        RequestModuleMapping moduleMapping = getModuleMapping(request);
        String applicationId = getApplicationId(request, context);
       
        if (moduleMapping != null) {
            processMapping(context, request, response, chain, moduleMapping, applicationId);
        } else {
View Full Code Here


        if (modulePrefixNode == null) {
            return null;
        }
       
        ModuleNameWithPath value = modulePrefixNode.getValue();
        return new RequestModuleMapping(modulePrefixNode.getKey(), value.getModuleName(), value.getServletPath());
    }
View Full Code Here

       
        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);
View Full Code Here

       
        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));
View Full Code Here

       
        verify(requestModuleMapper1, requestModuleMapper2, request);
    }
   
    public void testGetModuleOne() {
        RequestModuleMapping mapping = new RequestModuleMapping("/one", "one", null, null);
        expect(requestModuleMapper1.getModuleForRequest(request)).andReturn(mapping);
        replay(requestModuleMapper1, requestModuleMapper2, request);
       
        assertEquals(mapping, mapper.getModuleForRequest(request));
       
View Full Code Here

        verify(requestModuleMapper1, requestModuleMapper2, request);
    }
   
    public void testGetModuleTwo() {
        expect(requestModuleMapper1.getModuleForRequest(request)).andReturn(null);
        RequestModuleMapping mapping = new RequestModuleMapping("/two", "two", null, null);
        expect(requestModuleMapper2.getModuleForRequest(request)).andReturn(mapping);
       
        replay(requestModuleMapper1, requestModuleMapper2, request);
       
        assertEquals(mapping, mapper.getModuleForRequest(request));
View Full Code Here

public class TestMapper implements RequestModuleMapper {

    public RequestModuleMapping getModuleForRequest(HttpServletRequest request) {
        String parameter = request.getParameter("moduleName");
        if (parameter != null) {
            return new RequestModuleMapping("/" + parameter, parameter, null, null);
        }
        return null;
    }
View Full Code Here

        super.setUp();
        servletContext = createMock(ServletContext.class);
        request = createMock(HttpServletRequest.class);
        facade = createMock(ModuleManagementFacade.class);
       
        mapping = new RequestModuleMapping("/mymodule", "mymodule", null, null);
        applicationId = "";
    }
View Full Code Here

        expect(request.getParameter("moduleName")).andReturn("alternativemodule");
       
        replayMocks();
       
        servlet.init(new IntegrationServletConfig(initParameters, servletContext, "proxyServlet"));
        assertEquals(new RequestModuleMapping("/alternativemodule", "alternativemodule", null, null), servlet.getModuleMapping(request));

        verifyMocks();
    }
View Full Code Here

        final HashMap<String, String> initParameters = new HashMap<String, String>();
        initParameters.put(WebConstants.REQUEST_MODULE_MAPPER_CLASS_NAME, TestMapper.class.getName());
        filter.init(new IntegrationFilterConfig(initParameters, servletContext, "proxyServlet"));
       
        assertEquals(new RequestModuleMapping("/alternativemodule", "alternativemodule", null, null), filter.getModuleMapping(request));

        verifyMocks();
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.web.servlet.wrapper.RequestModuleMapping

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.