svn commit: r17312 - trunk/src/argouml-app/src/org/argouml: i18n profile/internal

Michiel van der Wulp <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2009-09-13 11:10:21-0700
New Revision: 17312

Modified:
   trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties
   trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java

Log:
Completed descriptions of critics.
Added some OCL critics.
Documented some test results - many of the OCL critics do not work yet.

Modified: trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties?view=diff&pathrev=17312&r1=17311&r2=17312
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties	(original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties	2009-09-13 11:10:21-0700
@@ -38,31 +38,101 @@
 
 wfr.UML142.ActionState.3-head = Transitions originating \
     from an action state have no trigger event.
-wfr.UML142.ActionState.3-desc = As soon as the incoming \
+wfr.UML142.ActionState.3-desc = Well-Formedness Rule 3 \
+    for an ActionState.\n\
+    As soon as the incoming \
     transition of an ActionState is triggered, its entry action starts \
     executing. Once the entry action has finished executing, the \
-    action is considered complete. "When the action is complete, \
+    action is considered complete. When the action is complete, \
     then the outgoing transition is enabled. \n\n\
     Hence the outgoing transition shall not have a trigger event.\n\n\
     To address this, remove the trigger event.
 
+
+wfr.UML142.Actor.1a-head = Actors can only have \
+    Associations that are binary.
+wfr.UML142.Actor.1a-desc = Well-Formedness Rule 1a for an Actor.\n\
+    Actors can only have associations that are binary.\n\n\
+    To address this, remove association ends from the association.
+wfr.UML142.Actor.1b-head = Actors can only have \
+    Associations to UseCases, Subsystems, and Classes.
+wfr.UML142.Actor.1b-desc = Well-Formedness Rule 1b for an Actor.\n\
+    Actors can only have \
+    Associations to UseCases, Subsystems, and Classes.
+wfr.UML142.Actor.2-head = Actors cannot contain any Classifiers.  
+wfr.UML142.Actor.2-desc = Well-Formedness Rule 2 for an Actor.\n\
+    Actors cannot contain any Classifiers.  
+
+
 wfr.UML142.AssociationClass.1-head = The names of the \
     AssociationEnds and the StructuralFeatures do not overlap.
+wfr.UML142.AssociationClass.1-desc = Well-Formedness Rule 1 \
+    for an AssociationClass.\n\
+    The names of the AssociationEnds and the StructuralFeatures \
+    do not overlap.
 wfr.UML142.AssociationClass.2-head =  An AssociationClass \
     cannot be defined between itself and something else.
+wfr.UML142.AssociationClass.2-desc =  Well-Formedness Rule 2 \
+    for an AssociationClass.\n\
+    An AssociationClass cannot be defined between itself \
+    and something else.
+
 
 wfr.UML142.Classifier.5-head = The name of an opposite \
     AssociationEnd may not be the same as the name of an Attribute \
     or a ModelElement contained in the Classifier.
+wfr.UML142.Classifier.5-desc = Well-Formedness Rule 5 \
+    for a Classifier.\n\
+    The name of an opposite AssociationEnd may not be the same \
+    as the name of an Attribute or a ModelElement contained in the Classifier.
+
 
 wfr.UML142.DataType.1-head = A DataType can only contain \
     Operations, which all must be queries.
+wfr.UML142.DataType.1-desc = Well-Formedness Rule 1 \
+    for a DataType.\n\
+    A DataType can only contain Operations, which all must be queries.
+
 
 wfr.UML142.GeneralizableElement.1-head =  A root cannot have any \
     Generalizations.
+wfr.UML142.GeneralizableElement.1-desc = Well-Formedness Rule 1 \
+    for a GeneralizableElement.\n\
+    A root cannot have any Generalizations.
 wfr.UML142.GeneralizableElement.4-head = The parent must be \
-included in the Namespace of the GeneralizableElement.
+    included in the Namespace of the GeneralizableElement.
+wfr.UML142.GeneralizableElement.4-desc = Well-Formedness Rule 4 \
+    for a GeneralizableElement.\n\
+    The parent must be included in the Namespace of the \
+    GeneralizableElement.
+
 
 wfr.UML142.Namespace.2-head = All Associations must have \
     a unique combination of name and associated Classifiers in \
     the Namespace.
+wfr.UML142.Namespace.2-desc = Well-Formedness Rule 2 for a \
+    Namespace.\n\
+    All Associations must have a unique combination of name and \
+    associated Classifiers in the Namespace.
+
+
+wfr.UML142.UseCase.1-head = UseCases can only have \
+    binary Associations.
+wfr.UML142.UseCase.1-desc = Well-Formedness Rule 1 for a UseCase.\n\
+    UseCases can only have \
+    binary Associations.
+wfr.UML142.UseCase.2-head = UseCases cannot have \
+    Associations to UseCases specifying the same entity.
+wfr.UML142.UseCase.2-desc = Well-Formedness Rule 2 for a UseCase.\n\
+    UseCases cannot have \
+    Associations to UseCases specifying the same entity.  
+wfr.UML142.UseCase.3-head = A UseCase cannot contain \
+    any Classifiers. 
+wfr.UML142.UseCase.3-desc = Well-Formedness Rule 3 for a UseCase.\n\
+    A UseCase cannot contain any Classifiers. 
+wfr.UML142.UseCase.4-head = The names of the \
+    ExtensionPoints must be unique within the UseCase. 
+wfr.UML142.UseCase.4-desc = Well-Formedness Rule 4 for a UseCase.\n\
+    The names of the ExtensionPoints must be unique within the UseCase. 
+
+

Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java?view=diff&pathrev=17312&r1=17311&r2=17312
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java	2009-09-13 11:10:21-0700
@@ -172,7 +172,7 @@
         
         // Association Class
         // 4.5.3.2 [1]
-        
+        /* Testing: does not fire. */
         try {
             critics.add(new CrOCL("context AssociationClass inv:"
                     + "self.allConnections->"
@@ -180,20 +180,20 @@
                     + "forAll( f | f.oclIsKindOf(StructuralFeature) "
                     + "implies ar.name <> f.name ))",
                     Translator.localize("wfr.UML142.AssociationClass.1-head"),
-                    null,
+                    Translator.localize("wfr.UML142.AssociationClass.1-desc"),
                     ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
         }
         
         // 4.5.3.2 [2]
-        
+        /* Testing: Works Ok. */
         try {
             critics.add(new CrOCL("context AssociationClass inv:"
                     + "self.allConnections->"
                     + "forAll(ar | ar.participant <> self)",
                     Translator.localize("wfr.UML142.AssociationClass.2-head"),
-                    null,
+                    Translator.localize("wfr.UML142.AssociationClass.2-desc"),
                     ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
@@ -219,6 +219,8 @@
         
         // Classifier
         // 4.5.3.8 [5]
+        /* TODO: Partly overlaps CrOppEndVsAttr. */
+        /* Testing: does not fire. */
         try {
             critics.add(new CrOCL("context Classifier inv:"
                     + "self.oppositeAssociationEnds->" 
@@ -226,7 +228,7 @@
                     + "union (self.allContents)->" 
                     + "collect ( q | q.name )->includes (o.name) )",
                 Translator.localize("wfr.UML142.Classifier.5-head"), 
-                null,
+                Translator.localize("wfr.UML142.Classifier.5-desc"), 
                 ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
@@ -234,12 +236,13 @@
 
         // DataType
         // 4.5.3.12 [1]
+        /* Tested with fabricated XMI - OK. */
         try {
             critics.add(new CrOCL("context DataType inv:"
                     + "self.allFeatures->forAll(f | f.oclIsKindOf(Operation)"
                     + " and f.oclAsType(Operation).isQuery)",
                     Translator.localize("wfr.UML142.DataType.1-head"),
-                    null,
+                    Translator.localize("wfr.UML142.DataType.1-desc"),
                     ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
@@ -247,24 +250,26 @@
 
         // GeneralizableElement
         // 4.5.3.20 [1]
+        /* Testing: does not fire. */
         try {
             critics.add(new CrOCL("context GeneralizableElement inv:"
                     + "self.isRoot implies self.generalization->isEmpty",
                     Translator.localize("wfr.UML142.GeneralizableElement.1-head"),
-                    null,
+                    Translator.localize("wfr.UML142.GeneralizableElement.1-desc"),
                     ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
         }
 
         // 4.5.3.20 [4]
+        /* Testing: does not fire. */
         try {
             critics.add(new CrOCL("context GeneralizableElement inv:"
                     + "self.generalization->"
                     + "forAll(g |self.namespace.allContents->"
                     + "includes(g.parent) )",
                     Translator.localize("wfr.UML142.GeneralizableElement.4-head"),
-                    null,
+                    Translator.localize("wfr.UML142.GeneralizableElement.4-desc"),
                     ToDoItem.HIGH_PRIORITY, null, null, "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();
@@ -272,6 +277,7 @@
  
         // Namespace
         // 4.5.3.26 [2]
+        /* Testing: Does not fire. Conflict with CrNameConflict. */
         try {
             critics.add(new CrOCL("context Namespace inv:"
                     + "self.allContents -> "
@@ -280,7 +286,121 @@
                     + "a1.connection.participant = a2.connection.participant"
                     + " implies a1 = a2)",
                     Translator.localize("wfr.UML142.Namespace.2-head"),
-                    null, ToDoItem.HIGH_PRIORITY, null, null,
+                    Translator.localize("wfr.UML142.Namespace.2-desc"),
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // Actor
+        // 4.11.3.1 [1]
+        /* Testing: does not fire. */
+        try {
+            critics.add(new CrOCL("context Actor inv: "
+                    + "self.associations->forAll(a | "
+                    + "a.connection->size = 2)",
+                    Translator.localize("wfr.UML142.Actor.1a-head"),
+                    Translator.localize("wfr.UML142.Actor.1a-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+        /* Testing: does not fire. */
+        try {
+            critics.add(new CrOCL("context Actor inv: "
+                    + "self.associations->forAll(a | "
+//                    + "a.allConnections->exists(r | r.type.oclIsKindOf(Actor)) and "
+                    + "a.allConnections->exists(r | "
+                    + "r.type.oclIsKindOf(UseCase) or "
+                    + "r.type.oclIsKindOf(Subsystem) or "
+                    + "r.type.oclIsKindOf(Class)))",
+                    Translator.localize("wfr.UML142.Actor.1b-head"),
+                    Translator.localize("wfr.UML142.Actor.1b-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // Actor
+        // 4.11.3.1 [2]
+        /* Tested with fabricated XMI - OK. */
+        try {
+            critics.add(new CrOCL("context Actor inv:"
+                    + "self.contents->isEmpty",
+                    Translator.localize("wfr.UML142.Actor.2-head"),
+                    Translator.localize("wfr.UML142.Actor.2-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // UseCase
+        // 4.11.3.5 [1]
+        /* Testing: does not fire. */
+        try {
+            critics.add(new CrOCL("context UseCase inv:"
+                    + "self.associations->forAll(a | a.connection->size = 2)",
+                    Translator.localize("wfr.UML142.UseCase.1-head"),
+                    Translator.localize("wfr.UML142.UseCase.1-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // UseCase
+        // 4.11.3.5 [2]
+        /* Testing: does not fire. */
+        try {
+            critics.add(new CrOCL("context UseCase inv:"
+                    + "self.associations->forAll(a | "
+                    + "a.allConnections->forAll(s, o| "
+                    + "(s.type.specificationPath->isEmpty and "
+                    + "o.type.specificationPath->isEmpty ) "
+                    + "or "
+                    + "(not s.type.specificationPath->includesAll( "
+                    + "o.type.specificationPath) and "
+                    + "not o.type.specificationPath->includesAll( "
+                    + "s.type.specificationPath)) "
+                    + "))",
+                    Translator.localize("wfr.UML142.UseCase.2-head"),
+                    Translator.localize("wfr.UML142.UseCase.2-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // UseCase
+        // 4.11.3.5 [3]
+        /* Tested with fabricated XMI - OK. */
+        try {
+            critics.add(new CrOCL("context UseCase inv:"
+                    + "self.contents->isEmpty",
+                    Translator.localize("wfr.UML142.UseCase.3-head"),
+                    Translator.localize("wfr.UML142.UseCase.3-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
+                    "http://www.uml.org/"));
+        } catch (InvalidOclException e) {
+            e.printStackTrace();
+        }
+
+        // UseCase
+        // 4.11.3.5 [4]
+        /* Tested OK, except in some cases, depending on the 
+         * sequence of the EPs. Probably the implementation of
+         * "forAll (x, y | ..." does not cover all combinations. */
+        try {
+            critics.add(new CrOCL("context UseCase inv:"
+                    + "self.allExtensionPoints -> forAll (x, y | "
+                    + "x.name = y.name implies x = y )",
+                    Translator.localize("wfr.UML142.UseCase.4-head"),
+                    Translator.localize("wfr.UML142.UseCase.4-desc"), 
+                    ToDoItem.HIGH_PRIORITY, null, null,
                     "http://www.uml.org/"));
         } catch (InvalidOclException e) {
             e.printStackTrace();

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2394330

To unsubscribe from this discussion, e-mail: [[email protected]].
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.