Package org.impalaframework.web.servlet.invocation

Examples of org.impalaframework.web.servlet.invocation.ModuleHttpServiceInvoker


        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap("f1", newFilter("somefilter")));
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap());
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap());

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertEquals(1, invoker.getFilters().size());
        assertEquals(0, invoker.getServlets().size());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here


        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap());
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap());
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap());

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertEquals(0, invoker.getFilters().size());
        assertEquals(0, invoker.getServlets().size());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here

     * mappings, and bind to the {@link ServletContext} context using the
     * attribute <code>ModuleHttpServiceInvoker.class.getName()+"."+moduleDefinition.getName()</code>
     */
    public void afterPropertiesSet() throws Exception {
       
        ModuleHttpServiceInvoker invoker = buildInvoker();
        servletContext.setAttribute(getAttributeName(), invoker);
    }
View Full Code Here

        }
       
        Map<String, List<Filter>> suffixFilters = initializeFilters(suffixFiltersMapping);
        Map<String, Servlet> suffixServlets = initializeServlets(suffixServletMapping);
       
        ModuleHttpServiceInvoker invoker = new ModuleHttpServiceInvoker(suffixFilters, suffixServlets);
       
        if (logger.isDebugEnabled()) {
            logger.debug("Module '" + moduleName + "' returning " + ModuleHttpServiceInvoker.class.getSimpleName() + ": " + invoker);
        }
       
View Full Code Here

        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap("f1", newFilter("myfilter")));
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap("s1", newServlet("myservlet")));
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap("c", moduleInvokerContributor));

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertFalse(invoker.getFilters().isEmpty());
        assertFalse(invoker.getServlets().isEmpty());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here

        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap("f1", newFilter("mymodule")));
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap("s1", newServlet("mymodule")));
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap());

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertEquals(0, invoker.getFilters().size());
        assertEquals(1, invoker.getServlets().size());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here

        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap("f1", newFilter("mymodule")));
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap("s1", newServlet("someservlet")));
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap());

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertEquals(1, invoker.getFilters().size());
        assertEquals(0, invoker.getServlets().size());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here

        expect(beanFactory.getBeansOfType(FilterFactoryBean.class)).andReturn(ObjectMapUtils.newMap("f1", newFilter("somefilter")));
        expect(beanFactory.getBeansOfType(ServletFactoryBean.class)).andReturn(ObjectMapUtils.newMap("s1", newServlet("someservlet")));
        expect(beanFactory.getBeansOfType(ModuleInvokerContributor.class)).andReturn(ObjectMapUtils.newMap());

        replay(beanFactory, servletContext);
        ModuleHttpServiceInvoker invoker = builder.buildInvoker();
        assertEquals(0, invoker.getFilters().size());
        assertEquals(1, invoker.getServlets().size());
       
        verify(beanFactory, servletContext);
    }
View Full Code Here

       
        expect(request.getRequestURI()).andStubReturn("/app/mymodule/resource.htm");

    Map<String, Servlet> servletMap = Collections.<String,Servlet>singletonMap("*", delegateServlet);
       
        expectGetInvoker("mymodule", new ModuleHttpServiceInvoker(
            new HashMap<String, List<Filter>>(),
            servletMap));
        delegateServlet.service(request, response);
       
        replayMocks();
View Full Code Here

        List<Filter> singletonList = Collections.singletonList(delegateFilter);
    Map<String, List<Filter>> filterMap = Collections.singletonMap("*", singletonList);
    Map<String, Servlet> servletMap = Collections.emptyMap();
   
    servletContext.setAttribute(ModuleHttpServiceInvoker.class.getName()+"."+"mymodule",
            new ModuleHttpServiceInvoker(
                    filterMap,
                    servletMap));
       
        expect(request.getRequestURI()).andStubReturn("/app/mymodule/path");
        delegateFilter.doFilter(eq(request), eq(response), isA(InvocationChain.class));
View Full Code Here

TOP

Related Classes of org.impalaframework.web.servlet.invocation.ModuleHttpServiceInvoker

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.