Package org.geppetto.core.model.runtime

Examples of org.geppetto.core.model.runtime.RuntimeTreeRoot


   * Skeleton tree test. Emulate one entity, one aspect and model tree
   * modified only
   */
  @Test
  public void testSkeletonRuntimeTreeOnlyModel() {
    RuntimeTreeRoot runtime = new RuntimeTreeRoot("root");

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);

    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);

    visualization.setModified(false);

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    simulation.setModified(false);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
    aspect_A.setParent(entity_A);
    aspect_A.setModified(true);
    aspect_A.addChild(model);
    aspect_A.addChild(visualization);
    aspect_A.addChild(simulation);

    SerializeTreeVisitor visitor = new SerializeTreeVisitor();
    runtime.apply(visitor);
    String serialized = visitor.getSerializedTree();
    System.out.println(serialized);

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    JsonParser jp = new JsonParser();
View Full Code Here


   * Skeleton tree test. One entity, one aspect, and only simulation tree
   * modified
   */
  @Test
  public void testSkeletonRuntimeTreeOnlySimulation() {
    RuntimeTreeRoot runtime = new RuntimeTreeRoot("root");

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);
    model.setModified(false);
    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);
    visualization.setModified(false);
    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
    aspect_A.setParent(entity_A);
    aspect_A.setModified(true);
    aspect_A.addChild(model);
    aspect_A.addChild(visualization);
    aspect_A.addChild(simulation);

    SerializeTreeVisitor visitor = new SerializeTreeVisitor();
    runtime.apply(visitor);
    String serialized = visitor.getSerializedTree();
    System.out.println(serialized);

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    JsonParser jp = new JsonParser();
View Full Code Here

   * Skeleton tree test. One entity with one aspect, and only visualization
   * modified
   */
  @Test
  public void testSkeletonRuntimeTreeOnlyVisualization() {
    RuntimeTreeRoot runtime = new RuntimeTreeRoot("root");

    EntityNode entity_A = new EntityNode("Entity_A");

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode model = new AspectSubTreeNode(
        AspectTreeType.MODEL_TREE);
    model.setModified(false);
    AspectSubTreeNode visualization = new AspectSubTreeNode(
        AspectTreeType.VISUALIZATION_TREE);

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);
    simulation.setModified(false);

    runtime.addChild(entity_A);
    entity_A.getAspects().add(aspect_A);
    entity_A.setModified(true);
    aspect_A.setParent(entity_A);
    aspect_A.setModified(true);
    aspect_A.addChild(model);
    aspect_A.addChild(visualization);
    aspect_A.addChild(simulation);

    SerializeTreeVisitor visitor = new SerializeTreeVisitor();
    runtime.apply(visitor);
    String serialized = visitor.getSerializedTree();
    System.out.println(serialized);

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    JsonParser jp = new JsonParser();
View Full Code Here

TOP

Related Classes of org.geppetto.core.model.runtime.RuntimeTreeRoot

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.