Package org.apache.shiro.util

Examples of org.apache.shiro.util.PatternMatcher.matches()


        expect(request.getAttribute(WebUtils.INCLUDE_CONTEXT_PATH_ATTRIBUTE)).andReturn("/context");
        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/mychain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/mychain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/mychain")).andReturn(true);

        Filter filter2a = ctrl.createMock(Filter.class);
        Filter filter2b = ctrl.createMock(Filter.class);
View Full Code Here


        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/mychain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/mychain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/mychain")).andReturn(true);

        Filter filter2a = ctrl.createMock(Filter.class);
        Filter filter2b = ctrl.createMock(Filter.class);

        expect((Filter)injector.getInstance(key2a)).andReturn(filter2a);
View Full Code Here

        expect(request.getAttribute(WebUtils.INCLUDE_CONTEXT_PATH_ATTRIBUTE)).andReturn("/context");
        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/nochain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainThree, "/nochain")).andReturn(false);

        ctrl.replay();
View Full Code Here

        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/nochain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainThree, "/nochain")).andReturn(false);

        ctrl.replay();

        assertNull("Expected no chain to match, did not get a null value in return.", underTest.getChain(request, response, originalChain));
View Full Code Here

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainThree, "/nochain")).andReturn(false);

        ctrl.replay();

        assertNull("Expected no chain to match, did not get a null value in return.", underTest.getChain(request, response, originalChain));
View Full Code Here

        String regex = pattern;
        if( regexPathMatcher )
          regex = replacePattern(pattern);
       
        try{
          return pathMatcher.matches(regex, path);
        }catch( PatternSyntaxException e ){
          //配置Ant表达式,容错处理
          if( regexPathMatcher )
            return getPathMatcher().matches(pattern,getPathWithinApplication(request));
        }
View Full Code Here

     * @return {@code true} if the request {@code path} matches the specified filter chain url {@code pattern},
     *         {@code false} otherwise.
     */
    protected boolean pathMatches(String pattern, String path) {
        PatternMatcher pathMatcher = getPathMatcher();
        return pathMatcher.matches(pattern, path);
    }

    /**
     * Merely returns
     * <code>WebUtils.{@link org.apache.shiro.web.util.WebUtils#getPathWithinApplication(javax.servlet.http.HttpServletRequest) getPathWithinApplication(request)}</code>
View Full Code Here

        expect(request.getAttribute(WebUtils.INCLUDE_CONTEXT_PATH_ATTRIBUTE)).andReturn("/context");
        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/mychain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/mychain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/mychain")).andReturn(true);

        Filter filter2a = ctrl.createMock(Filter.class);
        Filter filter2b = ctrl.createMock(Filter.class);
View Full Code Here

        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/mychain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/mychain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/mychain")).andReturn(true);

        Filter filter2a = ctrl.createMock(Filter.class);
        Filter filter2b = ctrl.createMock(Filter.class);

        expect(injector.getInstance(key2a)).andReturn(filter2a);
View Full Code Here

        expect(request.getAttribute(WebUtils.INCLUDE_CONTEXT_PATH_ATTRIBUTE)).andReturn("/context");
        expect(request.getAttribute(WebUtils.INCLUDE_REQUEST_URI_ATTRIBUTE)).andReturn("/nochain");

        expect(request.getCharacterEncoding()).andStubReturn(null);

        expect(patternMatcher.matches(chainOne, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainTwo, "/nochain")).andReturn(false);
        expect(patternMatcher.matches(chainThree, "/nochain")).andReturn(false);

        ctrl.replay();
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.