Package org.jboss.seam.bpm

Examples of org.jboss.seam.bpm.Actor


  
   @Test
   public void testActorDirtyChecking()
   {
      // Test dirty checking on id
      Actor actor = new Actor();
      assert !actor.clearDirty();
      actor.setId("gavin");
      assert actor.clearDirty();
      actor.setId("pete");
      assert actor.clearDirty();
     
      // Test dirty checking on group actor ids
      actor.getGroupActorIds().add("manager");
      assert actor.clearDirty();
      actor.getGroupActorIds().remove("manager");
      assert actor.clearDirty();
      actor.getGroupActorIds().add("director");
      actor.clearDirty();
      assert !actor.clearDirty();
      actor.getGroupActorIds().clear();
      assert actor.clearDirty();
     
     
      Set<String> someAdditions = new HashSet<String>();
      someAdditions.add("engineering manager");
      someAdditions.add("sales manager");
      Set<String> additions = new HashSet<String>();
      additions.add("marketing manager");
      additions.addAll(someAdditions);
      actor.getGroupActorIds().addAll(additions);
      assert actor.getGroupActorIds().size() == 3;
      assert actor.clearDirty();
      actor.getGroupActorIds().removeAll(additions);
      assert actor.clearDirty();
      assert actor.getGroupActorIds().size() == 0;
     
      actor.getGroupActorIds().addAll(additions);
      assert actor.getGroupActorIds().size() == 3;
      actor.clearDirty();
      actor.getGroupActorIds().retainAll(someAdditions);
      assert actor.clearDirty();
      assert actor.getGroupActorIds().size() == 2;
     
      // Test dirt checking on group actor ids iterator
      actor.getGroupActorIds().add("slave");
      actor.clearDirty();
      Iterator it = actor.getGroupActorIds().iterator();
      assert it.hasNext();
      it.next();
      it.remove();
      assert actor.clearDirty();
     
     
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.bpm.Actor

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.