Package org.jboss.security

Examples of org.jboss.security.NestablePrincipal$IndexEnumeration


    */
   public void testCloneNestablePrincipal() throws Exception
   {
      SimplePrincipal sp1 = new SimplePrincipal("sp1");
      SimplePrincipal sp2 = new SimplePrincipal("sp2");
      NestablePrincipal np = new NestablePrincipal("TestStack");
      //Add principals to the NestablePrincipal
      np.addMember(sp1);
      np.addMember(sp2);
      assertTrue("np.isMember(sp2)", np.isMember(sp2));
     
      //Clone the NestablePrincipal
      NestablePrincipal clonedNP = (NestablePrincipal)np.clone();
     
      //Remove a principal from the orig NestablePrincipal
      np.removeMember(sp2);
      //Only the active principal is valid
      assertFalse("np.isMember(sp2) == false", np.isMember(sp2));
      assertTrue("np.isMember(sp1)", np.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.NestablePrincipal$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.