svn commit: r15241 - trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-07-11 14:05:22-0700
New Revision: 15241

Modified:
   trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java

Log:
An attempt to reach 100% junit test coverage on this class. It must be possible...

Modified: trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java?view=diff&rev=15241&p1=trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java&p2=trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java&r1=15240&r2=15241
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	2008-07-11 14:05:22-0700
@@ -168,9 +168,28 @@
         assertNotNull("No entry action generated", entry);
         assertTrue("No UninterpretedAction generated", Model.getFacade()
                 .isAUninterpretedAction(entry));
+        /* If there is no script, then the language should not be maintained. */
+        Model.getCommonBehaviorHelper().setScript(entry, null);
+        notation.parse(aActionState, "testUA()");
+        Object script = Model.getFacade().getScript(entry);
+        assertTrue("Language not reset",
+                "".equals(Model.getDataTypesHelper().getLanguage(script)));
     }
 
     /**
+     * Test if a null body returns an empty string instead of null.
+     */
+    public void testNullBody() {
+        setUp2();
+        Object script = Model.getFacade().getScript(aUninterpretedAction);
+        Model.getDataTypesHelper().setBody(script, null);
+        ActionStateNotationUml notation = 
+            new ActionStateNotationUml(aActionState);
+        String result = notation.toString(aActionState, null);
+        assertTrue("Null body did not return empty string", "".equals(result));
+    }
+    
+    /**
      * Test if help is correctly provided.
      */
     public void testGetHelp() {
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.