Package easysm.datatypes.information

Examples of easysm.datatypes.information.StateObserverInfo


  }

  @Test
  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();
View Full Code Here


  }

  @Test
  public void Main_doGenerateStates_OneValidTable_ThreeState()
  {
    main.doAddStateObserver(new StateObserverInfo(stPino, Type.BOOLEAN, null));
    main.doAddStateObserver(new StateObserverInfo(stGino, Type.BOOLEAN, null));

    List<StateObserver> usedSet = main.stateObservers().soList();
    main.doSelectUsedSO(usedSet);
    main.doGenerateStateTable();
View Full Code Here

    Set<LiteralInfo> literals = SetFactory.createSet(LiteralInfo.class);
    literals.add(new LiteralInfo(stPino));
    literals.add(new LiteralInfo(stGino));
    EnumerationInfo eInfo = new EnumerationInfo(stTino, literals);
    Enumeration e = new Enumeration(eInfo);
    main.doAddStateObserver(new StateObserverInfo(stGino, Type.enumAsType(e), null));
    List<StateObserver> usedSet = main.stateObservers().soList();
    main.doSelectUsedSO(usedSet);
    main.doGenerateStateTable();

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

  @Test
  public void Main_doAddEvent_WithSameNameOfSO()
  {
    Set<ParameterInfo> params = SetFactory.createSet(ParameterInfo.class);
    main.doAddStateObserver(new StateObserverInfo(ePine, Type.INTEGER, null));
    main.doAddEvent(new EventInfo(ePine, params));
    List<Event> eSet = main.events().eventList();
    assertTrue(eSet.size() == 1);
  }
View Full Code Here

  }

  @Test
  public void Main_doAddStateObserver_OneValidSo()
  {
    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_doAddStateObserver_WithSameNameOfEvent()
  {
    Set<ParameterInfo> params = SetFactory.createSet(ParameterInfo.class);
    main.doAddEvent(new EventInfo(soIffy, params));
    main.doAddStateObserver(new StateObserverInfo(soIffy, Type.INTEGER, null));
    List<StateObserver> soSet = main.stateObservers().soList();
    assertTrue(soSet.size() == 1);
  }
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

  @Test
  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

TOP

Related Classes of easysm.datatypes.information.StateObserverInfo

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.