Examples of SyncWire


Examples of org.openiaml.model.model.wires.SyncWire

    setGeneratedBy(wire, by);
    return wire;
  }
 
  public SyncWire generatedSyncWire(GeneratesElements by, ContainsWires container, WireSource source, WireDestination target) throws InferenceException {
    SyncWire wire = createSyncWire(container, source, target);
    setGeneratedBy(wire, by);
    return wire;
  }
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    return page;
  }
 
  public SyncWire createSyncWire(ContainsWires container, WireSource source,
      WireDestination target) throws InferenceException {
    SyncWire wire = (SyncWire) createRelationship(container, WiresPackage.eINSTANCE.getSyncWire(), source, target, ModelPackage.eINSTANCE.getContainsWires_Wires(), ModelPackage.eINSTANCE.getWire_From(), ModelPackage.eINSTANCE.getWire_To());
    return wire;
  }
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    for (Object c : editor.getDiagramEditPart().getConnections()) {
      if (c instanceof ConnectionNodeEditPart) {
        ConnectionNodeEditPart connection = (ConnectionNodeEditPart) c;
        EObject element = connection.resolveSemanticElement();
        if (element instanceof SyncWire) {
          SyncWire w = (SyncWire) element;
          // SyncWires are bidirectional
          if (connection.getSource().equals(part1) &&
              connection.getTarget().equals(part2) && w.getName().equals(name))
            return connection;  // found it (a->b)
          if (connection.getSource().equals(part2) &&
              connection.getTarget().equals(part1) && w.getName().equals(name))
            return connection;  // found it (b->a)
          found += ", " + w.getName();
        }
      }
    }

    fail("assertHasSyncWire: no connection found between '" + part1 + "' and '" + part2 + "'. found: " + found);
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    // add another frame
    Frame page2 = gmf.createFrame(root);
    assertNotNull(page2);

    // create a SyncWire between the two
    SyncWire sync = gmf.createSyncWire(root, page, page2);
    assertNotNull(sync);

    // there should be four elements in this editor
    assertEditorHasChildren(4, editor);
  }
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    InputTextField mixed1 = assertHasInputTextField(home, "mixed 1");
    InputTextField mixed2 = assertHasInputTextField(home, "mixed 2");
    InputTextField mixed3 = assertHasInputTextField(home, "mixed 3");

    SyncWire s1 = assertHasSyncWire(root, normal1, normal2);
    assertFalse(s1.isExecuteOnInput());

    SyncWire s2 = assertHasSyncWire(root, instant1, instant2);
    assertTrue(s2.isExecuteOnInput());

    SyncWire s3a = assertHasSyncWire(root, mixed1, mixed2);
    assertTrue(s3a.isExecuteOnInput());

    SyncWire s3b = assertHasSyncWire(root, mixed2, mixed3);
    assertFalse(s3b.isExecuteOnInput());

  }
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

   
    Frame home = assertHasFrame(root, "Home");
    Frame p2 = assertHasFrame(root, "p2");
    Frame p3 = assertHasFrame(root, "p3");
   
    SyncWire sync1 = assertHasSyncWire(root, home, p2, "sync1");
    // bidirectional
    assertTrue(getHelper().connects(sync1, home, p2));
    assertTrue(getHelper().connects(sync1, p2, home));

    // does not connect unrelated
    assertFalse(getHelper().connects(sync1, home, p3));
    assertFalse(getHelper().connects(sync1, p3, home));
    assertFalse(getHelper().connects(sync1, home, home))// or self
   
    // bidirectional
    SyncWire sync2 = assertHasSyncWire(root, p3, p2, "sync");
    assertTrue(getHelper().connects(sync2, p3, p2));
    assertTrue(getHelper().connects(sync2, p2, p3));
   
  }
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    InputForm form = assertHasInputForm(page, "view student");
    DomainIterator studentInstance = assertHasDomainIterator(page, "current student");
    DomainInstance instance = studentInstance.getCurrentInstance();
    assertGenerated(instance);

    SyncWire sync = assertHasSyncWire(root, studentInstance, form, "sync");
    assertNotGenerated(sync);

    InputTextField field = assertHasInputTextField(form, "name");
    assertGenerated(field);
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

    InputForm form = assertHasInputForm(page, "new student form");
    DomainIterator studentInstance = assertHasDomainIterator(page, "new student");
    DomainInstance instance = studentInstance.getCurrentInstance();
    assertGenerated(instance);

    SyncWire sync = assertHasSyncWire(root, studentInstance, form, "sync");
    assertNotGenerated(sync);

    InputTextField field = assertHasInputTextField(form, "name");
    assertGenerated(field);
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

  public void testInference() throws JaxenException {
    Frame page = assertHasFrame(root, "container");
    InputTextField source = assertHasInputTextField(page, "source");
    InputTextField target = assertHasInputTextField(page, "target");
    SyncWire wire = assertHasSyncWire(page, source, target);
    Function cond = assertHasFunction(page, "Always False");

    // [inferred]
    // we should have Event 'edit' in source
    Event srcEdit = source.getOnChange();
View Full Code Here

Examples of org.openiaml.model.model.wires.SyncWire

  }

  public void testInference() throws JaxenException {
    Frame page1 = assertHasFrame(root, "page1");
    Frame page2 = assertHasFrame(root, "page2");
    SyncWire wire = (SyncWire) getWireBidirectional(root, page1, page2);

    InputTextField field1 = assertHasInputTextField(page1, "field");
    InputTextField field2 = assertHasInputTextField(page2, "field");
    assertNotSame(field1, field2);

    Function cond = assertHasFunction(root, "Always False");
    SimpleCondition cw = assertHasSimpleCondition(root, cond, wire);

    // [already in model]
    // there should be a Function wire from cond to sync
    assertEquals(cw.getFunction(), cond);
    assertEquals(cw.getConditioned(), wire);

    // [inferred]
    // field1 and field2 should be connected by SyncWires
    SyncWire sw = assertHasSyncWire(root, field1, field2);

    // we should have Event 'edit' in source
    Event srcEdit = field1.getOnChange();
    Operation srcOp = assertHasOperation(field1, "update");
    Event targetEdit = field2.getOnChange();
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.