Package common

Examples of common.WrappedActivity


  WrappedProcess proc3
      = new WrappedProcess(mgrFull.createProcess(requester));

  // Test activity of process 1
  assertTrue(proc1.steps().size() == 1);
  WrappedActivity act = (WrappedActivity)proc1.steps().toArray()[0];
  assertTrue(act.assignments().size() == 0);
  assertTrue(act.name() == null);
  assertTrue(act.priority() == 3); // Default priority
  assertTrue(act.container().key().equals(proc1.key()));
  assertTrue(act.nextActivities().size() == 0);

  // Test activities of processes 2 and 3
  assertTrue(proc2.steps().size() == 3);
  assertTrue(proc3.steps().size() == 3);
  Iterator it = proc2.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("ACT1")) {
    assertTrue(act.priority() == 1);
    assertTrue(act.description()
         .equals("Activity with dummy implementation"));
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.container().equals(proc2));
    assertTrue(act.nextActivities().size() == 1);
    acts.add("SET1");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT2")) {
    assertTrue(act.priority() == 2);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("SET1");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("SET1")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  it = proc3.steps().iterator();
  Set step3Keys = new HashSet();
  while (it.hasNext()) {
View Full Code Here


  // Test activities of process
  assertTrue(proc.steps().size() == 9);
  Iterator it = proc.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      WrappedActivity act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("ACT1")) {
    Util.sleep(15000);
    assertTrue(act.priority() == 1);
    assertTrue(act.description()
         .equals("Activity with dummy implementation"));
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.container().key().equals(proc.key()));
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B1");
    acts.add("B2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT2")) {
    Util.sleep(15000);
    assertTrue(act.priority() == 2);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B1");
    acts.add("B2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT3")) {
    assertTrue(act.priority() == 3);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else if (act.name().equals("ACT4")) {
    assertTrue(act.priority() == 4);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else if (act.name().equals("B0")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B3");
    acts.add("B4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B1")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("B0");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B2")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("B0");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B3")) {
    assertTrue(act.priority() == 5);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("ACT3");
    acts.add("ACT4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B4")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("ACT3");
    acts.add("ACT4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  procDir.removeProcess(proc.getWfProcess());
  Util.logExit("testActivitiesBlock1");
    }
View Full Code Here

  // Test activities of process
  assertTrue(proc.steps().size() == 15);
  Iterator it = proc.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      WrappedActivity act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("S1A1")) {
    Util.sleep(15000);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("S1A3");
    acts.add("S1A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A2")) {
    Util.sleep(15000);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("S1A3");
    acts.add("S1A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A1");
    acts.add("S3A1");
    acts.add("S3A2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A4")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A1");
    acts.add("S3A1");
    acts.add("S3A2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A1")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A2");
    acts.add("S2A3");
    acts.add("S2A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A2")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A4")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A1")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S3A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A2")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S3A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A1")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A2")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A3")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A4")) {
    assertTrue(act.nextActivities().size() == 0);
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  procDir.removeProcess(proc.getWfProcess());
  Util.logExit("testActivitiesBlock2");
    }
View Full Code Here

  WrappedProcess proc3
      = new WrappedProcess(mgrFull.createProcess(requester));

  // Test activity of process 1
  assertTrue(proc1.steps().size() == 1);
  WrappedActivity act = (WrappedActivity)proc1.steps().toArray()[0];
  Util.sleep(15000);
  assertTrue(act.assignments().size() == 0);
  assertTrue(act.name() == null);
  assertTrue(act.priority() == 3); // Default priority
  assertTrue(act.container().key().equals(proc1.key()));
  assertTrue(act.nextActivities().size() == 0);

  // Test activities of processes 2 and 3
  assertTrue(proc2.steps().size() == 3);
  assertTrue(proc3.steps().size() == 3);
  Iterator it = proc2.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("ACT1")) {
    Util.sleep(15000);
    assertTrue(act.priority() == 1);
    assertTrue(act.description()
         .equals("Activity with dummy implementation"));
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.container().equals(proc2));
    assertTrue(act.nextActivities().size() == 1);
    acts.add("SET1");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT2")) {
    assertTrue(act.priority() == 2);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("SET1");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("SET1")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  it = proc3.steps().iterator();
  Set step3Keys = new HashSet();
  while (it.hasNext()) {
View Full Code Here

  // Test activities of process
  assertTrue(proc.steps().size() == 9);
  Iterator it = proc.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      WrappedActivity act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("ACT1")) {
    assertTrue(act.priority() == 1);
    assertTrue(act.description()
         .equals("Activity with dummy implementation"));
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.container().key().equals(proc.key()));
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B1");
    acts.add("B2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT2")) {
    assertTrue(act.priority() == 2);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B1");
    acts.add("B2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("ACT3")) {
    assertTrue(act.priority() == 3);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else if (act.name().equals("ACT4")) {
    assertTrue(act.priority() == 4);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 0);
      } else if (act.name().equals("B0")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("B3");
    acts.add("B4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B1")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("B0");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B2")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 1);
    acts.add("B0");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B3")) {
    assertTrue(act.priority() == 5);
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("ACT3");
    acts.add("ACT4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("B4")) {
    assertTrue(act.priority() == 3); // default priority
    assertTrue(act.description() == null);
    assertTrue(act.assignments().size() == 0);
    assertTrue(act.nextActivities().size() == 2);
    acts.add("ACT3");
    acts.add("ACT4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  procDir.removeProcess(proc.getWfProcess());
    }
View Full Code Here

  // Test activities of process
  assertTrue(proc.steps().size() == 15);
  Iterator it = proc.steps().iterator();
  List acts = new LinkedList();
  while (it.hasNext()) {
      WrappedActivity act = (WrappedActivity)it.next();
      acts.clear();
      if (act.name().equals("S1A1")) {
    assertTrue(act.nextActivities().size() == 2);
    acts.add("S1A3");
    acts.add("S1A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A2")) {
    assertTrue(act.nextActivities().size() == 2);
    acts.add("S1A3");
    acts.add("S1A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A1");
    acts.add("S3A1");
    acts.add("S3A2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S1A4")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A1");
    acts.add("S3A1");
    acts.add("S3A2");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A1")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S2A2");
    acts.add("S2A3");
    acts.add("S2A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A2")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S2A4")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A1")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S3A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A2")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S3A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S3A3")) {
    assertTrue(act.nextActivities().size() == 3);
    acts.add("S4A1");
    acts.add("S4A2");
    acts.add("S4A3");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A1")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A2")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A3")) {
    assertTrue(act.nextActivities().size() == 1);
    acts.add("S4A4");
    assertTrue(activitiesIncluded(act.nextActivities(), acts));
      } else if (act.name().equals("S4A4")) {
    assertTrue(act.nextActivities().size() == 0);
      } else {
    assertTrue("Invalid activity " + act.name(), false);
      }
  }
  procDir.removeProcess(proc.getWfProcess());
    }
View Full Code Here

TOP

Related Classes of common.WrappedActivity

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.