/** Test creation. */
  public void testCreates() {
    CheckUMLModelHelper.createAndRelease(
        Model.getExtensionMechanismsFactory(), getTestableModelElements());

    ExtensionMechanismsFactory emFactory = Model.getExtensionMechanismsFactory();
    Object model = Model.getModelManagementFactory().createModel();
    Object stereo = emFactory.buildStereotype("mystereo1", model);
    try {
      emFactory.buildTagDefinition("myTDx", stereo, model);
      fail("Illegal buildTagDefinition with both sterotype" + " and model didn't throw exception.");
    } catch (IllegalArgumentException e) {
      // Expected
    }
    emFactory.buildTagDefinition("myTD1", stereo, null);
    emFactory.buildTagDefinition("myTD2", stereo, null, "Boolean");
    Collection tds =
        Model.getModelManagementHelper()
            .getAllModelElementsOfKind(model, Model.getMetaTypes().getTagDefinition());
    assertEquals("TagDefinition not deleted", 2, tds.size());
  }
Пример #2
0
 /** Test stereotypes. */
 public void testIsValidStereoType() {
   CheckUMLModelHelper.isValidStereoType(
       Model.getCoreFactory(), TestCoreFactory.getTestableModelElements());
 }
Пример #3
0
 /** Test getting the metamodel name. */
 public void testGetMetaModelName() {
   CheckUMLModelHelper.metaModelNameCorrect(
       Model.getCoreFactory(), TestCoreFactory.getTestableModelElements());
 }