RoleGroup principalRole = SecurityTestUtil.getRoleGroup(new String[] {"roleA"});
//Create a ContextMap
Map<String,Object> cmap = new HashMap<String,Object>();
EJBResource ejbResource = new EJBResource(cmap);
ejbResource.setEjbName("TestEJB");
ejbResource.setEjbMethod(DummyClass.class.getMethod("someMethod", new Class[0]));
ejbResource.setEjbMethodInterface("void someMethod");
ejbResource.setEjbMethodRoles(SecurityTestUtil.getRoleGroup(new String[]{"roleA"}));
//For Security Role Refs, we check that there is a principal
ejbResource.setPrincipal(new SimplePrincipal("SomePrincipal"));
//Additional entries needed for role ref
Set<SecurityRoleRef> roleRefSet = new HashSet<SecurityRoleRef>();
SecurityRoleRef srr = new SecurityRoleRef( "roleLink", "roleA", "something");
roleRefSet.add(srr);
ejbResource.setSecurityRoleReferences(roleRefSet);
cmap.put(ResourceKeys.ROLEREF_PERM_CHECK, Boolean.TRUE);
cmap.put(ResourceKeys.ROLENAME, "roleLink");
AuthorizationContext ac = new JBossAuthorizationContext("test",