Examples of FilterChainResolver


Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        if ((urls != null && !urls.isEmpty()) || (filters != null && !filters.isEmpty())) {
            //either the urls section or the filters section was defined.  Go ahead and create the resolver
            //and set it:
            IniFilterChainResolverFactory filterChainResolverFactory = new IniFilterChainResolverFactory(ini, defaults);
            filterChainResolverFactory.setFilterConfig(getFilterConfig());
            FilterChainResolver resolver = filterChainResolverFactory.getInstance();
            setFilterChainResolver(resolver);
        }
    }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        this.objects.clear();

        WebSecurityManager securityManager = createWebSecurityManager();
        setWebSecurityManager(securityManager);

        FilterChainResolver resolver = createFilterChainResolver();
        if (resolver != null) {
            setFilterChainResolver(resolver);
        }
    }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        return ini;
    }

    protected FilterChainResolver createFilterChainResolver() {

        FilterChainResolver resolver = null;

        Ini ini = getIni();

        if (!CollectionUtils.isEmpty(ini)) {
            //only create a resolver if the 'filters' or 'urls' sections are defined:
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

    }

    @Test
    public void testConstructor() {
        WebSecurityManager securityManager = createMock(WebSecurityManager.class);
        FilterChainResolver filterChainResolver = createMock(FilterChainResolver.class);
        ServletContext servletContext = createMock(ServletContext.class);

        Capture<WebGuiceEnvironment> capture = new Capture<WebGuiceEnvironment>();
        servletContext.setAttribute(eq(EnvironmentLoaderListener.ENVIRONMENT_ATTRIBUTE_KEY), and(anyObject(WebGuiceEnvironment.class), capture(capture)));
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        PatternMatcher patternMatcher = createMock(PatternMatcher.class);

        underTest.injector = injector;
        underTest.setPatternMatcher(patternMatcher);

        FilterChainResolver resolver = underTest.get();

        Field chainsField = SimpleFilterChainResolver.class.getDeclaredField("chains");
        chainsField.setAccessible(true);
        Field injectorField = SimpleFilterChainResolver.class.getDeclaredField("injector");
        injectorField.setAccessible(true);
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        return filter.getFilterChainResolver();
    }

    @Test
    public void testSimple() throws Exception {
        FilterChainResolver resolver = setupResolver();
        HttpServletResponse response = createNiceMock(HttpServletResponse.class);
        FilterChain chain = createNiceMock(FilterChain.class);
        HttpServletRequest request = createMockRequest("/index.html");

        FilterChain resolved = resolver.getChain(request, response, chain);
        assertNotNull(resolved);
        verify(request);
    }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        verify(request);
    }

    @Test
    public void testWithConfig() throws Exception {
        FilterChainResolver resolver = setupResolver();
        HttpServletResponse response = createNiceMock(HttpServletResponse.class);
        FilterChain chain = createNiceMock(FilterChain.class);
        HttpServletRequest request = createMockRequest("/index2.html");

        FilterChain resolved = resolver.getChain(request, response, chain);
        assertNotNull(resolved);
        verify(request);
    }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

    public void setFilterConfig(FilterConfig filterConfig) {
        this.filterConfig = filterConfig;
    }

    protected FilterChainResolver createInstance(Ini ini) {
        FilterChainResolver filterChainResolver = createDefaultInstance();
        if (filterChainResolver instanceof PathMatchingFilterChainResolver) {
            PathMatchingFilterChainResolver resolver = (PathMatchingFilterChainResolver) filterChainResolver;
            FilterChainManager manager = resolver.getFilterChainManager();
            buildChains(manager, ini);
        }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        if ((urls != null && !urls.isEmpty()) || (filters != null && !filters.isEmpty())) {
            //either the urls section or the filters section was defined.  Go ahead and create the resolver
            //and set it:
            IniFilterChainResolverFactory filterChainResolverFactory = new IniFilterChainResolverFactory(ini, defaults);
            filterChainResolverFactory.setFilterConfig(getFilterConfig());
            FilterChainResolver resolver = filterChainResolverFactory.getInstance();
            setFilterChainResolver(resolver);
        }
    }
View Full Code Here

Examples of org.apache.shiro.web.filter.mgt.FilterChainResolver

        assertNull(factory.getFilterConfig());
    }

    @Test
    public void testGetInstanceNoIni() {
        FilterChainResolver resolver = factory.getInstance();
        assertNotNull(resolver);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.