assertEquals(groupInstance.getGroupDN(), groupDN);
assertTrue(groupInstance.isMember(user1DN));
assertTrue(groupInstance.isMember(user2DN));
assertFalse(groupInstance.isMember(user3DN));
MemberList memberList = groupInstance.getMembers();
while (memberList.hasMoreMembers())
{
DN memberDN = memberList.nextMemberDN();
assertTrue(memberDN.equals(user1DN) || memberDN.equals(user2DN));
}
SearchFilter filter = SearchFilter.createFilterFromString("(uid=user.1)");
memberList = groupInstance.getMembers(DN.decode("o=test"),
SearchScope.WHOLE_SUBTREE, filter);
assertTrue(memberList.hasMoreMembers());
DN memberDN = memberList.nextMemberDN();
assertTrue(memberDN.equals(user1DN));
assertFalse(memberList.hasMoreMembers());
filter = SearchFilter.createFilterFromString("(uid=user.3)");
memberList = groupInstance.getMembers(DN.decode("o=test"),
SearchScope.WHOLE_SUBTREE, filter);
assertFalse(memberList.hasMoreMembers());
// Modify the group and make sure the group manager gets updated
// accordingly.
LinkedList<Modification> mods = new LinkedList<Modification>();