Examples of AuthorizationCache


Examples of org.wso2.carbon.caching.core.authorization.AuthorizationCache

        }
        CarbonContextHolder.getCurrentCarbonContextHolder();
    }

    public void testAddToCache() {
        AuthorizationCache cache = AuthorizationCache.getInstance();
        try {
            cache.isUserAuthorized("roadrunner","/x/y", "read");
            fail("This user is not yet added. Should be a cache miss");
        } catch (AuthorizationCacheException e) {
            assertTrue(true);           
        }
    }
View Full Code Here

Examples of org.wso2.carbon.caching.core.authorization.AuthorizationCache

            assertTrue(true);           
        }
    }

    public void testAddCacheHit() {
        AuthorizationCache cache = AuthorizationCache.getInstance();
        try {
            cache.isUserAuthorized("roadrunner", "/x/y", "read");
            fail("This user is not yet added. Should be a cache miss");
        } catch (AuthorizationCacheException e) {
            assertTrue(true);
        }

        try {
            cache.addToCache("roadrunner", "/x/y", "read", true);

            boolean b = cache.isUserAuthorized("roadrunner", "/x/y", "read");
            assertTrue(b);
           
        } catch (AuthorizationCacheException e) {
            fail("Should be a cache hit.");
        }
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.