*/
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));
}