Package org.impalaframework.web.integration

Examples of org.impalaframework.web.integration.IntegrationServletConfig


        request = createMock(HttpServletRequest.class);
    }
   
    public void testGetModuleForRequest() {
        expect(request.getRequestURI()).andReturn("/app/mymodule/resource.htm");
        mapper.init(new IntegrationServletConfig(initParameters, servletContext, "filterServlet"));
       
        replay(request);
        assertEquals(new RequestModuleMapping("/mymodule", "mymodule", null, null), mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here


    public void testGetModuleForRequestWithPrefix() {
        initParameters.put("modulePrefix", "someprefix");
       
        expect(request.getRequestURI()).andReturn("/app/mymodule/resource.htm");
        mapper.init(new IntegrationServletConfig(initParameters, servletContext, "filterServlet"));
       
        replay(request);
        assertEquals(new RequestModuleMapping("/mymodule", "someprefixmymodule", null, null), mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here

    public void testGetModuleWithFilter() {
        initParameters.put("modulePrefix", "anotherprefix");
        mapper.init(new IntegrationFilterConfig(initParameters, servletContext, "filterServlet"));
       
        expect(request.getRequestURI()).andReturn("/app/mymodule/resource.htm");
        mapper.init(new IntegrationServletConfig(initParameters, servletContext, "filterServlet"));
       
        replay(request);
        assertEquals(new RequestModuleMapping("/mymodule", "anotherprefixmymodule", null, null), mapper.getModuleForRequest(request));
        verify(request);
    }
View Full Code Here

        frameworkLockHolder.readUnlock();
       
        replayMocks();
        HashMap<String, String> initParameters = new HashMap<String, String>();
        initParameters.put("delegateServletBeanName", "myServletBeanName");
        servlet.init(new IntegrationServletConfig(
                initParameters, servletContext, "myservlet"));
        servlet.doService(request, response);
        verifyMocks();
    }
View Full Code Here

    }

    public void testInitDestroy() throws ServletException {

        replayMocks();
        servlet.init(new IntegrationServletConfig(new HashMap<String, String>(), servletContext, "myservlet"));
        servlet.destroy();
        verifyMocks();
    }
View Full Code Here

            }
            servletName = moduleDefintion.getName();
        }
       
        servlet = ObjectUtils.cast(BeanUtils.instantiateClass(servletClass), Servlet.class);
        IntegrationServletConfig config = newServletConfig(initParameters);
       
        if (servlet instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) servlet;
            awa.setApplicationContext(applicationContext);
        }
View Full Code Here

    }

    /* ***************** protected methods **************** */

    private IntegrationServletConfig newServletConfig(Map<String, String> parameterMap) {
        IntegrationServletConfig config = new IntegrationServletConfig(parameterMap, this.servletContext, this.servletName);
        return config;
    }
View Full Code Here

        }
       
        servlet = (HttpServlet) BeanUtils.instantiateClass(servletClass);
        Map<String, String> emptyMap = Collections.emptyMap();
        Map<String,String> parameterMap = (initParameters != null ? initParameters : emptyMap);
        IntegrationServletConfig config = newServletConfig(parameterMap);
       
        if (servlet instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) servlet;
            awa.setApplicationContext(applicationContext);
        }
View Full Code Here

        initServletProperties(servlet);    
        servlet.init(config);
    }

    private IntegrationServletConfig newServletConfig(Map<String, String> parameterMap) {
        IntegrationServletConfig config = new IntegrationServletConfig(parameterMap, this.servletContext, this.servletName);
        return config;
    }
View Full Code Here

    public void testApplicationContext() throws Exception {

        final FrameworkServlet frameworkServlet = createMock(FrameworkServlet.class);
        expect(frameworkServlet.getServletContextAttributeName()).andStubReturn("attName");
        expect(frameworkServlet.getServletConfig()).andStubReturn(new IntegrationServletConfig(new HashMap<String, String>(), servletContext, "myservlet" ));
        replay(frameworkServlet);
       
        final WebApplicationContext applicationContext = createMock(WebApplicationContext.class);
        ImpalaServletUtils.publishWebApplicationContext(applicationContext, frameworkServlet);
       
View Full Code Here

TOP

Related Classes of org.impalaframework.web.integration.IntegrationServletConfig

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.