1102N/A * The contents of this file are subject to the terms of the 1102N/A * Common Development and Distribution License, Version 1.0 only 1102N/A * (the "License"). You may not use this file except in compliance 1102N/A * You can obtain a copy of the license at 1102N/A * See the License for the specific language governing permissions 1102N/A * and limitations under the License. 1102N/A * When distributing Covered Code, include this CDDL HEADER in each 1102N/A * file and include the License file at 1102N/A * add the following below this CDDL HEADER, with the fields enclosed 1102N/A * by brackets "[]" replaced with your own identifying information: 1102N/A * Portions Copyright [yyyy] [name of copyright owner] 5218N/A * Copyright 2008-2010 Sun Microsystems, Inc. 5886N/A * Portions Copyright 2012 ForgeRock AS 1102N/A * A set of test cases for the virtual static group implementation and the 1102N/A * member virtual attribute provider. 1102N/A * The lines comprising the LDIF test data. 1102N/A "objectClass: organizationalUnit",
1102N/A "dn: uid=test.1,ou=People,o=test",
1102N/A "objectClass: organizationalPerson",
1102N/A "objectClass: inetOrgPerson",
1102N/A "dn: uid=test.2,ou=People,o=test",
1102N/A "objectClass: organizationalPerson",
1102N/A "objectClass: inetOrgPerson",
1102N/A "dn: uid=test.3,ou=People,o=test",
1102N/A "objectClass: organizationalPerson",
1102N/A "objectClass: inetOrgPerson",
1102N/A "dn: uid=test.4,ou=People,o=test",
1102N/A "objectClass: organizationalPerson",
1102N/A "objectClass: inetOrgPerson",
1102N/A "objectClass: organizationalUnit",
1102N/A "dn: cn=Dynamic All Users,ou=Groups,o=test",
1102N/A "objectClass: groupOfURLs",
1102N/A "memberURL: ldap:///ou=People,o=test??sub?(objectClass=person)",
1102N/A "dn: cn=Dynamic One User,ou=Groups,o=test",
1102N/A "objectClass: groupOfURLs",
1102N/A "memberURL: ldap:///ou=People,o=test??sub?(&(objectClass=person)(sn=4))",
1102N/A "dn: cn=Static member List,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "member: uid=test.1,ou=People,o=test",
1102N/A "member: uid=test.3,ou=People,o=test",
1102N/A "dn: cn=Static uniqueMember List,ou=Groups,o=test",
1102N/A "objectClass: groupOfUniqueNames",
1102N/A "cn: Static uniqueMember List",
1102N/A "uniqueMember: uid=test.2,ou=People,o=test",
1102N/A "uniqueMember: uid=test.3,ou=People,o=test",
1102N/A "uniqueMember: uid=no-such-user,ou=People,o=test",
1102N/A "dn: cn=Virtual member All Users,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual member All Users",
1102N/A "ds-target-group-dn: cn=Dynamic All Users,ou=Groups,o=test",
1102N/A "dn: cn=Virtual uniqueMember All Users,ou=Groups,o=test",
1102N/A "objectClass: groupOfUniqueNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual uniqueMember All Users",
1102N/A "ds-target-group-dn: cn=Dynamic All Users,ou=Groups,o=test",
1102N/A "dn: cn=Virtual member One User,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual member One User",
1102N/A "ds-target-group-dn: cn=Dynamic One User,ou=Groups,o=test",
1102N/A "dn: cn=Virtual uniqueMember One User,ou=Groups,o=test",
1102N/A "objectClass: groupOfUniqueNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual uniqueMember One User",
1102N/A "ds-target-group-dn: cn=Dynamic One User,ou=Groups,o=test",
1102N/A "dn: cn=Virtual Static member List,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual Static member List",
1102N/A "ds-target-group-dn: cn=Static member List,ou=Groups,o=test",
1102N/A "dn: cn=Virtual Static uniqueMember List,ou=Groups,o=test",
1102N/A "objectClass: groupOfUniqueNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Virtual Static uniqueMember List",
1102N/A "ds-target-group-dn: cn=Static uniqueMember List,ou=Groups,o=test",
1102N/A "dn: cn=Crossover member Static Group,ou=Groups,o=test",
1102N/A "objectClass: groupOfUniqueNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Crossover member Static Group",
1102N/A "ds-target-group-dn: cn=Static member List,ou=Groups,o=test",
1102N/A "dn: cn=Crossover uniqueMember Static Group,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Crossover uniqueMember Static Group",
1102N/A "ds-target-group-dn: cn=Static uniqueMember List,ou=Groups,o=test",
1102N/A "dn: cn=Virtual Nonexistent,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "ds-target-group-dn: cn=Nonexistent,ou=Groups,o=test" 1102N/A // The attribute type for the member attribute. 1102N/A // The attribute type for the uniqueMember attribute. 1102N/A // The server group manager. 1102N/A // The DNs of the various entries in the data set. 1102N/A * Ensures that the Directory Server is running. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Tests creating a new instance of a virtual static group from a valid entry. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A "dn: cn=Valid Virtual Static Group,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "cn: Valid Virtual Static Group",
1102N/A "ds-target-group-dn: cn=Static member List,ou=Groups,o=test");
1102N/A * Retrieves a set of invalid vittual static group definition entries. 1102N/A * @return A set of invalid virtul static group definition entries. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A "dn: cn=Not a Virtual Static Group,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "cn: Not a Virtual Static Group",
1102N/A "member: uid=test.1,ou=People,o=test",
1102N/A "dn: cn=No Target,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "dn: cn=Invalid Target,ou=Groups,o=test",
1102N/A "objectClass: groupOfNames",
1102N/A "objectClass: ds-virtual-static-group",
1102N/A "ds-target-group-dn: invalid");
1102N/A * Tests creating a new instance of a virtual static group from an invalid 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Performs general tests of the group API for virtual static groups with a 1102N/A * group that has a real target group. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A fail(
"Expected an exception from addNestedGroupDN");
1102N/A fail(
"Expected an exception from removeNestedGroupDN");
1102N/A fail(
"Expected an exception from removeMember");
1102N/A * Performs general tests of the group API for virtual static groups with a 1102N/A * group that has a nonexistent target group. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A fail(
"Expected an exception from isMember(DN)");
1102N/A fail(
"Expected an exception from isMember(Entry)");
1102N/A fail(
"Expected an exception from getMembers()");
1102N/A fail(
"Expected an exception from getMembers(base, scope, filter)");
1102N/A fail(
"Expected an exception from addNestedGroupDN");
1102N/A fail(
"Expected an exception from removeNestedGroupDN");
1102N/A fail(
"Expected an exception from removeMember");
1102N/A * Tests the behavior of the virtual static group with a dynamic group. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Tests the behavior of the virtual static group with a static group based on 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Tests the behavior of the virtual static group with a static group based on 1102N/A * the uniqueMember attribute. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Performs general tests of the virtual attribute provider API for the member 1102N/A * virtual attribute with a target group that exists. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Performs general tests of the virtual attribute provider API for the member 1102N/A * virtual attribute with a target group that does not exist. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Tests the behavior of the member virtual attribute with a dynamic group. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A * Tests the behavior of the member virtual attribute with a dynamic group. 1102N/A * The target dynamic group will initially have only one memberURL which 1102N/A * matches only one user, but will then be updated on the fly to contain a 1102N/A * second URL that matches all users. 1102N/A * @throws Exception If an unexpected problem occurs. 1102N/A "ldap:///o=test??sub?(objectClass=person)")));
1112N/A * Tests the behavior of the member virtual attribute with different settings 1112N/A * for the "allow retrieving membership" attribute. 1112N/A * @throws Exception If an unexpected problem occurs. 1112N/A DN.
decode(
"cn=Virtual Static member,cn=Virtual Attributes,cn=config");
1102N/A * Removes all of the groups that have been added to the server. 1102N/A * @throws Exception If an unexpected problem occurs.