public void testFormalizedComponentClassOperationDTAssignement() throws CoreException {
    Component_c component =
        Component_c.ComponentInstance(
            modelRoot,
            new ClassQueryInterface_c() {

              public boolean evaluate(Object candidate) {
                return ((Component_c) candidate).getName().equals("IF Scope Test Component");
              }
            });
    assertNotNull(component);
    if (!component.Isformal()) formalizeComponent(component);
    Operation_c op = Operation_c.OperationInstance(modelRoot);
    OperationO_TFRPropertySource ps = new OperationO_TFRPropertySource(op);
    ps.getPropertyDescriptors();
    ps.setPropertyValue("DataType", "component_ref");
    DataType_c dt = DataType_c.getOneS_DTOnR116(op);
    SystemModel_c testSys = null;
    if (testGlobals) {
      testSys =
          SystemModel_c.getOneS_SYSOnR9100(
              GlobalElementInSystem_c.getOneG_EISOnR9100(
                  PackageableElement_c.getOnePE_PEOnR8001(dt)));
    } else {
      testSys =
          SystemModel_c.getOneS_SYSOnR4402(SystemDatatypeInPackage_c.getOneSLD_SDINPOnR4401(dt));
    }
    assertTrue("The chosen dt was not a system level one as expected.", testSys != null);
  }
 public void testGlobalMigrationSymbolicConstantDomain() throws Exception {
   Ooaofooa testRoot =
       Ooaofooa.getInstance("/model_upgrade/models/model_upgrade/domain/domain.xtuml");
   SymbolicConstant_c param = SymbolicConstant_c.SymbolicConstantInstance(testRoot);
   assertNotNull("Unable to locate test element", param);
   DataType_c dt = DataType_c.getOneS_DTOnR1500(param);
   assertNotNull("Unable to locate test element", dt);
   GlobalElementInSystem_c gis =
       GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
   assertNotNull("SymbolicConstant was not migrated to use globals.", gis);
   assertTrue(
       "Incorrect data type associated with SymbolicConstant after global migration",
       dt.getName().equals("string"));
 }
 public void testGlobalMigrationOperationParameterDomain() throws Exception {
   Ooaofooa testRoot =
       Ooaofooa.getInstance("/model_upgrade/models/model_upgrade/domain/domain.xtuml");
   OperationParameter_c param = OperationParameter_c.OperationParameterInstance(testRoot);
   assertNotNull("Unable to locate test element", param);
   DataType_c dt = DataType_c.getOneS_DTOnR118(param);
   assertNotNull("Unable to locate test element", dt);
   GlobalElementInSystem_c gis =
       GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
   assertNotNull("OperationParameter was not migrated to use globals.", gis);
   assertTrue(
       "Incorrect data type associated with OperationParameter after global migration",
       dt.getName().equals("inst_ref<Timer>"));
 }
 public void testGlobalMigrationInterfaceOperation() throws Exception {
   Ooaofooa testRoot =
       Ooaofooa.getInstance(
           "/model_upgrade/models/model_upgrade/InterfacePackage/InterfacePackage.xtuml");
   InterfaceOperation_c param = InterfaceOperation_c.InterfaceOperationInstance(testRoot);
   assertNotNull("Unable to locate test element", param);
   DataType_c dt = DataType_c.getOneS_DTOnR4008(param);
   assertNotNull("Unable to locate test element", dt);
   GlobalElementInSystem_c gis =
       GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
   assertNotNull("InterfaceOperation was not migrated to use globals.", gis);
   assertTrue(
       "Incorrect data type associated with InterfaceOperation after global migration",
       dt.getName().equals("real"));
 }
 public void testGlobalMigrationUserDataTypeComponent() throws Exception {
   Ooaofooa testRoot =
       Ooaofooa.getInstance(
           "/model_upgrade/models/model_upgrade/ComponentPackage/ComponentPackage.xtuml");
   UserDataType_c param = UserDataType_c.UserDataTypeInstance(testRoot);
   assertNotNull("Unable to locate test element", param);
   DataType_c dt = DataType_c.getOneS_DTOnR18(param);
   assertNotNull("Unable to locate test element", dt);
   GlobalElementInSystem_c gis =
       GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
   assertNotNull("UserDataType was not migrated to use globals.", gis);
   assertTrue(
       "Incorrect data type associated with UserDataType after global migration",
       dt.getName().equals("boolean"));
 }
 public void testGlobalMigrationStateMachineEventDataItemComponent() throws Exception {
   Ooaofooa testRoot =
       Ooaofooa.getInstance(
           "/model_upgrade/models/model_upgrade/ComponentPackage/ComponentPackage.xtuml");
   StateMachineEventDataItem_c param =
       StateMachineEventDataItem_c.StateMachineEventDataItemInstance(testRoot);
   assertNotNull("Unable to locate test element", param);
   DataType_c dt = DataType_c.getOneS_DTOnR524(param);
   assertNotNull("Unable to locate test element", dt);
   GlobalElementInSystem_c gis =
       GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
   assertNotNull("StateMachineEventDataItem was not migrated to use globals.", gis);
   assertTrue(
       "Incorrect data type associated with StateMachineEventDataItem after global migration",
       dt.getName().equals("timestamp"));
 }
  public void testGlobalMigrationBridgeParameterDomain() throws Exception {
    Ooaofooa testRoot =
        Ooaofooa.getInstance("/model_upgrade/models/model_upgrade/domain/domain.xtuml");
    BridgeParameter_c param =
        BridgeParameter_c.BridgeParameterInstance(
            testRoot,
            new ClassQueryInterface_c() {

              @Override
              public boolean evaluate(Object candidate) {
                return ((BridgeParameter_c) candidate).getName().equals("message");
              }
            });
    assertNotNull("Unable to locate test element", param);
    DataType_c dt = DataType_c.getOneS_DTOnR22(param);
    assertNotNull("Unable to locate test element", dt);
    GlobalElementInSystem_c gis =
        GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
    assertNotNull("BridgeParameter was not migrated to use globals.", gis);
    assertTrue(
        "Incorrect data type associated with BridgeParameter after global migration",
        dt.getName().equals("string"));
  }
  public void testGlobalMigrationAttributeComponent() throws Exception {
    Ooaofooa testRoot =
        Ooaofooa.getInstance(
            "/model_upgrade/models/model_upgrade/ComponentPackage/ComponentPackage.xtuml");
    Attribute_c param =
        Attribute_c.AttributeInstance(
            testRoot,
            new ClassQueryInterface_c() {

              @Override
              public boolean evaluate(Object candidate) {
                return ((Attribute_c) candidate).getName().equals("attribute");
              }
            });
    assertNotNull("Unable to locate test element", param);
    DataType_c dt = DataType_c.getOneS_DTOnR114(param);
    assertNotNull("Unable to locate test element", dt);
    GlobalElementInSystem_c gis =
        GlobalElementInSystem_c.getOneG_EISOnR9100(PackageableElement_c.getOnePE_PEOnR8001(dt));
    assertNotNull("Attribute was not migrated to use globals.", gis);
    assertTrue(
        "Incorrect data type associated with Attribute after global migration",
        dt.getName().equals("boolean"));
  }