Package org.jboss.security

Examples of org.jboss.security.NestableGroup$IndexEnumeration


     
      SimpleGroup sg1 = new SimpleGroup("sg1");
      SimpleGroup sg2 = new SimpleGroup("sg1");
      sg1.addMember(sp1);
      sg2.addMember(sp2);
      NestableGroup ng = new NestableGroup("TestGroup");
      //Add principals to the NestablePrincipal
      ng.addMember(sg1);
      ng.addMember(sg2);
      assertTrue("ng.isMember(sp2)", ng.isMember(sp2));
     
      //Clone the NestableGroup
      NestableGroup clonedNP = (NestableGroup)ng.clone();
     
      //Remove a group from the orig NestableGroup
      ng.removeMember(sg2);
      //Only the active principal is valid
      assertFalse("ng.isMember(sp2) == false", ng.isMember(sp2));
      assertTrue("ng.isMember(sp1)", ng.isMember(sp1));
      //Check that the cloned NestablePrincipal is not affected
      assertTrue("clonedNP.isMember(sp2)", clonedNP.isMember(sp2));
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.NestableGroup$IndexEnumeration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.