Search in sources :

Example 11 with ResourcePermission

use of org.apache.geode.security.ResourcePermission in project geode by apache.

the class ResourcePermissionTest method testEmptyConstructor.

@Test
public void testEmptyConstructor() {
    context = new ResourcePermission();
    assertEquals(Resource.NULL, context.getResource());
    assertEquals(Operation.NULL, context.getOperation());
    assertEquals(ResourcePermission.ALL_REGIONS, context.getRegionName());
}
Also used : ResourcePermission(org.apache.geode.security.ResourcePermission) UnitTest(org.apache.geode.test.junit.categories.UnitTest) SecurityTest(org.apache.geode.test.junit.categories.SecurityTest) Test(org.junit.Test)

Example 12 with ResourcePermission

use of org.apache.geode.security.ResourcePermission in project geode by apache.

the class ResourcePermissionTest method testToString.

@Test
public void testToString() {
    context = new ResourcePermission();
    assertEquals("NULL:NULL", context.toString());
    context = new ResourcePermission("DATA", "MANAGE");
    assertEquals("DATA:MANAGE", context.toString());
    context = new ResourcePermission("DATA", "MANAGE", "REGIONA");
    assertEquals("DATA:MANAGE:REGIONA", context.toString());
    context = new ResourcePermission("data", "manage");
    assertEquals("DATA:MANAGE", context.toString());
}
Also used : ResourcePermission(org.apache.geode.security.ResourcePermission) UnitTest(org.apache.geode.test.junit.categories.UnitTest) SecurityTest(org.apache.geode.test.junit.categories.SecurityTest) Test(org.junit.Test)

Aggregations

ResourcePermission (org.apache.geode.security.ResourcePermission)12 SecurityTest (org.apache.geode.test.junit.categories.SecurityTest)5 UnitTest (org.apache.geode.test.junit.categories.UnitTest)5 Test (org.junit.Test)5 WildcardPermission (org.apache.shiro.authz.permission.WildcardPermission)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 Serializable (java.io.Serializable)1 HashMap (java.util.HashMap)1 AttributeNotFoundException (javax.management.AttributeNotFoundException)1 IntrospectionException (javax.management.IntrospectionException)1 MBeanFeatureInfo (javax.management.MBeanFeatureInfo)1 MBeanInfo (javax.management.MBeanInfo)1 GemFireSecurityException (org.apache.geode.security.GemFireSecurityException)1