Package easysm.stores

Examples of easysm.stores.StateObserver


  public void Main_doGenerateStates_OneValidTable_OneState()
  {
    StateObserverInfo soInfo = new StateObserverInfo(stPino, Type.BOOLEAN, null);
    main.doAddStateObserver(soInfo);
    List<StateObserver> usedSet = ListFactory.createList(StateObserver.class);
    usedSet.add(new StateObserver(soInfo));
    main.doSelectUsedSO(usedSet);
    main.doGenerateStateTable();

    List<Row> rows = main.stateTable().rows();
    assertTrue(rows.size() == 2);
View Full Code Here


  {
    StateObserverInfo soInfo = new StateObserverInfo(soPine, Type.INTEGER, null);
    main.doAddStateObserver(soInfo);
    List<StateObserver> soSet = main.stateObservers().soList();
    assertTrue(soSet.size() == 2);
    assertTrue(soSet.contains(new StateObserver(soInfo)));
  }
View Full Code Here

  @Test
  public void Main_doUpdateStateObserver_OneValidStateObserver()
  {
    main.doAddStateObserver(new StateObserverInfo(soIffy, Type.INTEGER, null));
    List<StateObserver> soSet = main.stateObservers().soList();
    StateObserver so = null;
    for (StateObserver s : soSet) {
      if (s.name().equals(soIffy))
        so = s;
    }
    StateObserverInfo soInfo = new StateObserverInfo(soPine, Type.BOOLEAN, null);
    main.doUpdateStateObserver(so, soInfo);
    assertTrue(soSet.size() == 2);
    assertTrue(so.name().equals(soPine));
    assertTrue(so.type().equals(Type.BOOLEAN));
    assertTrue(so.invariant().equals(Expr.EMPTY));
  }
View Full Code Here

  @Test
  public void doDeleteStateObserver()
  {
    main.doAddStateObserver(new StateObserverInfo(soIffy, Type.INTEGER, null));
    StateObserver soToDelete = main.stateObservers().soList().get(1);
    main.doDeleteStateObserver(soToDelete);
    assertTrue(main.stateObservers().soList().size() == 1);
  }
View Full Code Here

  @Test
  public void doAddStateObserver_OneValidInvariant()
  {
    Expr e = new Expr("Pine");
    StateObserverInfo soInfo = new StateObserverInfo(soPine, Type.INTEGER, e);
    StateObserver so = new StateObserver(soInfo);
    main.doAddStateObserver(soInfo);
    assertTrue(so.invariant().equals(e));
  }
View Full Code Here

  public void doUpdateStateObserver_changeInvariant()
  {
    Expr e = new Expr("Pine");
    StateObserverInfo soInfo = new StateObserverInfo(soPine, Type.INTEGER, e);
    main.doAddStateObserver(soInfo);
    StateObserver so = new StateObserver(soInfo);
    Expr newE = new Expr("Pino");
    StateObserverInfo newSoInfo = new StateObserverInfo(soPine, Type.INTEGER, newE);
    main.doUpdateStateObserver(so, newSoInfo);
    assertTrue(so.name().equals(soPine));
    assertTrue(so.type().equals(Type.INTEGER));
    assertTrue(so.invariant().equals(newE));
  }
View Full Code Here

  public void doUpdateStateObserver_OneNullInvariant()
  {
    Expr e = new Expr("Pine");
    StateObserverInfo soInfo = new StateObserverInfo(soPine, Type.INTEGER, e);
    main.doAddStateObserver(soInfo);
    StateObserver so = new StateObserver(soInfo);
    StateObserverInfo newSoInfo = new StateObserverInfo(soPine, Type.INTEGER, Expr.EMPTY);
    main.doUpdateStateObserver(so, newSoInfo);
    assertTrue(so.name().equals(soPine));
    assertTrue(so.type().equals(Type.INTEGER));
    assertTrue(so.invariant().equals(Expr.EMPTY));
  }
View Full Code Here

TOP

Related Classes of easysm.stores.StateObserver

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.