public void testCreatingDynamicACL() throws Exception { this.setRoleFileName("src/test/DynamicACLRoleConfig.xml"); this.setConfigurationFileName("src/test/ACLComponentConfig.xml");
public void testCreatingDynamicACL() throws Exception {
    public void testCreatingDynamicACL() throws Exception    {        this.setRoleFileName("src/test/DynamicACLRoleConfig.xml");        this.setConfigurationFileName("src/test/ACLComponentConfig.xml");        ACLFactory factory = (ACLFactory) lookup(ACLFactory.ROLE);        DynamicUser user = new DynamicUser();        user.setName("bob");        user.setId(new Integer(1));        DynamicGroup group = new DynamicGroup();        group.setName("group1");        group.setId(new Integer(1));        DynamicRole role = new DynamicRole();        role.setName("role1");        role.setId(new Integer(1));        DynamicPermission permission = new DynamicPermission();        permission.setName("permission1");        permission.setId(new Integer(1));        role.addPermission(permission);        group.addRole(role);        user.addGroup(group);        AccessControlList acl = factory.getAccessControlList(user);        assertTrue(acl instanceof DynamicAccessControlList);        DynamicAccessControlList dacl = (DynamicAccessControlList) acl;        assertTrue(dacl.hasPermission(permission));    }