Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-418

Member.getGroups(field) assumes default members list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: HEAD
    • Fix Version/s: 1.6.0
    • Component/s: API
    • Labels:
      None

      Description

      On 4/14/10 11:32 PM, Tom Zeller wrote:
      > >>
      > >> One of my tests was failing in trunk, it looks like because
      > >> Member.getGroups(Field) doesn't behave the same in trunk as it did in
      > >> 1.5.
      > >>
      > >> Basically, if GroupA is a member of GroupB of the default list, then
      > >> GroupA.toMember().getGroups(customField) shouldn't return GroupB.
      > >> Right ?
      > >>
      > >> It also looks like Member.getGroups(Field) is untested, i.e. I find no
      > >> tests referring to it, only me
      > >>
      > >> I ran the test case below, and the output is different for 1.5 and trunk.
      > >>
      > >> trunk :
      > >> groups Group[name=edu:groupB,uuid=2ff78f01e1d943288059f3ef19743469]
      > >> groups custom Group[name=edu:groupB,uuid=2ff78f01e1d943288059f3ef19743469]
      > >>
      > >> v1_5 :
      > >> groups Group[name=edu:groupB,uuid=f81b7a6169204143a61213c80c086a60]
      > >>
      > >> public class TestBasic extends GrouperTest {
      > >>
      > >> public void testOne() throws Exception {
      > >> GrouperSession grouperSession = GrouperSession.startRootSession();
      > >> Stem root =
      > >> StemHelper.findRootStem(GrouperSession.staticGrouperSession());
      > >> Stem edu = StemHelper.addChildStem(root, "edu", "education");
      > >>
      > >> GroupType type = GroupType.createType(grouperSession, "groupType");
      > >> type.addAttribute(grouperSession, "attr1", AccessPrivilege.VIEW,
      > >> AccessPrivilege.UPDATE, false);
      > >> type.addList(grouperSession, "customList", AccessPrivilege.READ,
      > >> AccessPrivilege.UPDATE);
      > >> Field customList = FieldFinder.find("customList", true);
      > >>
      > >> Group groupA = StemHelper.addChildGroup(edu, "groupA", "Group A");
      > >>
      > >> Group groupB = StemHelper.addChildGroup(edu, "groupB", "Group B");
      > >> groupB.addType(type);
      > >> groupB.addMember(groupA.toSubject());
      > >> groupB.store();
      > >>
      > >> for (Group g : groupA.toMember().getGroups())

      { > >> System.out.println("groups " + g); > >> }

      > >>
      > >> for (Group g : groupA.toMember().getGroups(customList))

      { > >> System.out.println("groups custom " + g); > >> }

      > >> }
      > >> }
      > >>
      >
      >

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              shilen.patel@at.internet2.edu Shilen Patel (duke.edu)
              Reporter:
              shilen.patel@at.internet2.edu Shilen Patel (duke.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: