svn commit: r13626 - trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-09-27 09:23:44-0700
New Revision: 13626

Modified:
   trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java

Log:
Make sure stereotype and tag definition names are unique so there's no ambiguity between elements created in different tests.

Modified: trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java?view=diff&rev=13626&p1=trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java&p2=trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java&r1=13625&r2=13626
==============================================================================
--- trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java	(original)
+++ trunk/tests/org/argouml/model/TestExtensionMechanismsFactory.java	2007-09-27 09:23:44-0700
@@ -66,9 +66,6 @@
      */
     static List<String> getTestableModelElements() {
         List<String> c = new ArrayList<String>(Arrays.asList(allModelElements));
-        // TODO: Stereotype was untested before, but I'm not sure if it was
-        // intentional.  Seems more like an oversight. - tfm
-//        c.remove("Stereotype");
         return c;
     }
     
@@ -100,16 +97,21 @@
         ExtensionMechanismsFactory emFactory =
             Model.getExtensionMechanismsFactory();
         Object model = Model.getModelManagementFactory().createModel();
-        Object stereo = emFactory.buildStereotype("mystereo", model);
+        Object stereo = emFactory.buildStereotype("mystereo1", model);
         try {
-            emFactory.buildTagDefinition("myTD", stereo, model);
+            emFactory.buildTagDefinition("myTDx", stereo, model);
             fail("Illegal buildTagDefinition with both sterotype"
                     + " and model didn't throw exception.");
         } catch (IllegalArgumentException e) {
             // Expected
         }
-        emFactory.buildTagDefinition("myTD", stereo, null);
-        emFactory.buildTagDefinition("myTD", stereo, null, "Boolean");
+        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());
     }
 
     /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.