Examples of WaitResultTest


Examples of org.mitre.sim.test.WaitResultTest

    public void eventIsHere(String msg) {
    }

    public void eventSimple() {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "eventSimple", entity));
    }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

    public void eventSimple() {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "eventSimple", entity));
    }

    public void eventBad() {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "eventBad", entity));
      @SuppressWarnings("unused")
      int i = 1 / 0;
    }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

      @SuppressWarnings("unused")
      int i = 1 / 0;
    }

    public void exceptionHandler(Exception e) {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "exceptionHandler", entity));
    }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

    public void exceptionHandler(Exception e) {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "exceptionHandler", entity));
    }

    public void initialize() {
      fifo.add(new WaitResultTest(entity.getTimeNow(), "Initialize begun", entity));
      try {
        entity.schedule("eventThatDoesNotExist", 2.0);
      }
      catch (IllegalArgumentException e) {
        fifo.add(new WaitResultTest(entity.getTimeNow(), "not there", entity));
      }
      try {
        entity.schedule("eventIsHere", 2.0);
      }
      catch (IllegalArgumentException e) {
        fifo.add(new WaitResultTest(entity.getTimeNow(), "wrong signature 1", entity));
      }
      try {
        entity.schedule("eventIsHere", 2.0, 6.0);
      }
      catch (IllegalArgumentException e) {
        fifo.add(new WaitResultTest(entity.getTimeNow(), "wrong signature 2", entity));
      }
      try {
        entity.schedule("eventSimple", -1.0);
      }
      catch (IllegalArgumentException e) {
        fifo.add(new WaitResultTest(entity.getTimeNow(), "negative delay", entity));
      }
      entity.schedule("eventIsHere", 2.0, "A String");
      fifo.add(new WaitResultTest(entity.getTimeNow(), "right signature", entity));
      entity.schedule("eventSimple", 2.0);
      fifo.add(new WaitResultTest(entity.getTimeNow(), "simple signature", entity));
      try {
        entity.schedule("agenda", 2.0);
      }
      catch (IllegalArgumentException e) {
        fifo.add(new WaitResultTest(entity.getTimeNow(), "agenda", entity));
      }
      entity.schedule("eventBad", 1.0);
      fifo.add(new WaitResultTest(entity.getTimeNow(), "Initialize end", entity));
    }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

  }

  public class TestSimulation extends Simulation {

    public void initialize() {
      fifo.add(new WaitResultTest(0.0, register(new EntityOne()).getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityTwo(), "FishLegs").getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityTwo(), "").getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityTwo(), " ").getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityTwo(), "  ").getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityOne()).getName(), null));
      fifo.add(new WaitResultTest(0.0, register(new EntityTwo(), null).getName(), null));
    }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

  /**
    Add a <code>WaitResultTest</code> object to the list.
    @param o <code>WaitResult</code> to be added.
   */
  public boolean add(WaitResult o) {
    return list.add(new WaitResultTest(o));
  }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

  /**
    Add record to list with Entity and current sim time.
    @param e <code>Entity</code> to be added.
   */
  public boolean add(Entity e) {
    return list.add(new WaitResultTest(e.getTimeNow(), null, e));
  }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

    Add record to list with Entity, current sim time, and comment.
    @param e <code>Entity</code> to be added.
    @param comment comment to be added
   */
  public boolean add(Entity e, String comment) {
    return list.add(new WaitResultTest(e.getTimeNow(), comment, e));
  }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

    Add record to list with Simulation's current sim time, and comment.
    @param s <code>Simulation</code> whose time is to be added.
    @param comment comment to be added
   */
  public boolean add(Simulation s, String comment) {
    return list.add(new WaitResultTest(s.getTimeNow(), comment, null));
  }
View Full Code Here

Examples of org.mitre.sim.test.WaitResultTest

            matches; <code>null</code> if none found
   */
  public WaitResultTest among(int theIndex,
                              int numberToConsider,
                              String entityName) {
    WaitResultTest returned = null;
    for (int i = theIndex; i < theIndex + numberToConsider; i++) {
      WaitResultTest wr = (WaitResultTest) list.get(i);
      if (wr.getEntity() != null)
        if (wr.getEntity().getName().equals(entityName)) {
          returned = wr;
          break;
        }
    }
    return returned;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.