Package org.jboss.test.security.interfaces

Examples of org.jboss.test.security.interfaces.ACLSession


    */
   public void testGetEntitlementsFromEJB() throws Exception
   {
      // lookup the test session.
      Object obj = getInitialContext().lookup("ACLSessionImpl/remote");
      ACLSession session = (ACLSession) PortableRemoteObject.narrow(obj, ACLSession.class);

      // get the entitlements for the Administrator identity.
      Map<Integer, String> entitlementsMap = session.getEntitlementsForIdentity("Administrator");
      assertEquals("ACLSession retrieved an invalid number of entitlement entries", 2, entitlementsMap.size());
      // Administrator should have CREATE,READ and UPDATE permissions on both resources (id=10 and id=11).
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(10));
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(11));

      // now repeat the process, this time using the identity "Guest".
      entitlementsMap = session.getEntitlementsForIdentity("Guest");
      assertEquals("ACLSession retrieved an invalid number of entitlement entries", 2, entitlementsMap.size());
      // Guest should have CREATE, READ and UPDATE permissions on resource 10 and READ permission on resource 11.
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(10));
      assertEquals("Invalid entitlement entry found", "READ", entitlementsMap.get(11));
   }
View Full Code Here


    */
   public void testGetEntitlementsFromEJB() throws Exception
   {
      // lookup the test session.
      Object obj = getInitialContext().lookup("ACLSessionImpl/remote");
      ACLSession session = (ACLSession) PortableRemoteObject.narrow(obj, ACLSession.class);

      // get the entitlements for the Administrator identity.
      Map<Integer, String> entitlementsMap = session.getEntitlementsForIdentity("Administrator");
      assertEquals("ACLSession retrieved an invalid number of entitlement entries", 2, entitlementsMap.size());
      // Administrator should have CREATE,READ and UPDATE permissions on both resources (id=10 and id=11).
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(10));
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(11));

      // now repeat the process, this time using the identity "Guest".
      entitlementsMap = session.getEntitlementsForIdentity("Guest");
      assertEquals("ACLSession retrieved an invalid number of entitlement entries", 2, entitlementsMap.size());
      // Guest should have CREATE, READ and UPDATE permissions on resource 10 and READ permission on resource 11.
      assertEquals("Invalid entitlement entry found", "CREATE,READ,UPDATE", entitlementsMap.get(10));
      assertEquals("Invalid entitlement entry found", "READ", entitlementsMap.get(11));
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.security.interfaces.ACLSession

Copyright © 2018 www.massapicom. 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.