Examples of AssetPathAuthorizer


Examples of org.apache.tapestry5.services.AssetPathAuthorizer

    @Test
    public void checks_authorizers() throws IOException
    {
        Logger logger = createMock(Logger.class);
        List<AssetPathAuthorizer> auths = new ArrayList<AssetPathAuthorizer>();
        AssetPathAuthorizer auth = createMock(AssetPathAuthorizer.class);

        expect(auth.order()).andReturn(Arrays.asList(AssetPathAuthorizer.Order.ALLOW, AssetPathAuthorizer.Order.DENY)).times(2);

        expect(auth.accessAllowed("/cayenne.xml")).andReturn(false);
        expect(auth.accessDenied("/cayenne.xml")).andReturn(true);
        expect(auth.accessAllowed("/org/apache/tapestry/default.css")).andReturn(true);
        auths.add(auth);

        logger.debug("Denying access to /cayenne.xml");
        logger.debug("Allowing access to /org/apache/tapestry/default.css");
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.