svn commit: r13615 - trunk/tests/org/argouml: persistence uml uml/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-09-26 23:28:16-0700
New Revision: 13615

Modified:
   trunk/tests/org/argouml/persistence/TestZargoFilePersister.java
   trunk/tests/org/argouml/uml/TestProfileJava.java
   trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java

Log:
Complete merge of profile work from Marcus Aurelio's GSoC branch.

Modified: trunk/tests/org/argouml/persistence/TestZargoFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/persistence/TestZargoFilePersister.java?view=diff&rev=13615&p1=trunk/tests/org/argouml/persistence/TestZargoFilePersister.java&p2=trunk/tests/org/argouml/persistence/TestZargoFilePersister.java&r1=13614&r2=13615
==============================================================================
--- trunk/tests/org/argouml/persistence/TestZargoFilePersister.java	(original)
+++ trunk/tests/org/argouml/persistence/TestZargoFilePersister.java	2007-09-26 23:28:16-0700
@@ -39,9 +39,6 @@
 import org.argouml.notation.InitNotation;
 import org.argouml.notation.providers.java.InitNotationJava;
 import org.argouml.notation.providers.uml.InitNotationUml;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
-import org.argouml.uml.ProfileJava;
 import org.argouml.uml.diagram.ui.InitDiagramAppearanceUI;
 
 /**
@@ -187,14 +184,10 @@
      * 
      * @throws OpenException
      * @throws InterruptedException
-     * @throws ProfileException 
      */
     public void testLoadLinkedProfile() throws OpenException,
-            InterruptedException, ProfileException {
-        // Make sure our profile is loaded
-        Profile profile = new ProfileJava();
-        Collection profileModel = profile.getProfilePackages();
-        
+            InterruptedException {
+     
         // Load a project which contains links to it
         Project p = doLoad("/testmodels/uml14/LinkedProfile.zargo");
         

Modified: trunk/tests/org/argouml/uml/TestProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/uml/TestProfileJava.java?view=diff&rev=13615&p1=trunk/tests/org/argouml/uml/TestProfileJava.java&p2=trunk/tests/org/argouml/uml/TestProfileJava.java&r1=13614&r2=13615
==============================================================================
--- trunk/tests/org/argouml/uml/TestProfileJava.java	(original)
+++ trunk/tests/org/argouml/uml/TestProfileJava.java	2007-09-26 23:28:16-0700
@@ -26,10 +26,12 @@
 
 import java.util.Collection;
 
-import org.argouml.model.Model;
-
 import junit.framework.TestCase;
+
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
+import org.argouml.model.Model;
+import org.argouml.uml.profile.ProfileConfiguration;
 
 /**
  * 
@@ -51,27 +53,21 @@
     /*
      * @see junit.framework.TestCase#setUp()
      */
+    @Override
     public void setUp() throws Exception {
 	super.setUp();
         InitializeModel.initializeDefault();
     }
 
     /**
-     * Test whether we can load default model (profile). ProfileJava will throw
-     * an exception for an invalid profile model, but just create and return an
-     * empty model if the file for the profile doesn't exist. Check
-     * for both failure modes.
-     * 
-     * @throws ProfileException
-     *             exception thrown by ProfileJava for invalid profile file.
+     * Test whether we can load default model (profile).
      */
-    public void testLoadProfileModel() throws ProfileException {
-        ProfileJava profile = new ProfileJava();
-        Object model = profile.getProfileModel();
-        assertNotNull("Can't load profile model", model);
-        Collection stereos = Model.getModelManagementHelper()
-                .getAllModelElementsOfKind(model,
-                        Model.getMetaTypes().getStereotype());
-        assertTrue("No stereotypes found in profile model", stereos.size() > 0);
+    public void testLoadProfileModel() {
+        ProfileConfiguration config = ProjectManager.getManager()
+                .getCurrentProject().getProfileConfiguration();
+        assertNotNull("Can't load profile configuration", config);
+        Collection stereos = config.findAllStereotypesForModelElement(Model
+                .getCoreFactory().createClass());
+        assertTrue("No stereotypes found in default profiles", stereos.size() > 0);
     }
 }

Modified: trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java?view=diff&rev=13615&p1=trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java&p2=trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java&r1=13614&r2=13615
==============================================================================
--- trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java	(original)
+++ trunk/tests/org/argouml/uml/ui/MockUMLUserInterfaceContainer.java	2007-09-26 23:28:16-0700
@@ -26,7 +26,7 @@
 
 import java.util.Iterator;
 
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 
 /**
  * @since Oct 12, 2002
@@ -44,86 +44,34 @@
         super();
     }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#getTarget()
-     */
+
     public Object getTarget() {
         return target;
     }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#getModelElement()
-     */
+
     public Object getModelElement() {
         return null;
     }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#getProfile()
-     */
-    public Profile getProfile() {
-        return null;
-    }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatElement(java.lang.Object)
-     */
-    public String formatElement(/*ModelElement*/Object element) {
+    public ProfileConfiguration getProfile() {
         return null;
     }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatCollection(java.util.Iterator)
-     */
-    public String formatCollection(Iterator iter) {
+    
+    public String formatElement(Object element) {
         return null;
     }
 
-    /**
-     * @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatNamespace(java.lang.Object)
-     */
-    public String formatNamespace(/*Namespace*/Object ns) {
-        return null;
-    }
 
-    /**
-     * @see org.argouml.ui.NavigationListener#navigateTo(java.lang.Object)
-     */
-    public void navigateTo(Object element) {
-    }
-
-    /**
-     * @see org.argouml.ui.NavigationListener#open(java.lang.Object)
-     */
-    public void open(Object element) {
-    }
-
-    /**
-     * @see org.argouml.ui.NavigationListener#navigateBack(boolean)
-     */
-    public boolean navigateBack(boolean attempt) {
-        return false;
-    }
-
-    /**
-     * @see org.argouml.ui.NavigationListener#navigateForward(boolean)
-     */
-    public boolean navigateForward(boolean attempt) {
-        return false;
+    public String formatCollection(Iterator iter) {
+        return null;
     }
 
-    /**
-     * @see org.argouml.ui.NavigationListener#isNavigateBackEnabled()
-     */
-    public boolean isNavigateBackEnabled() {
-        return false;
-    }
 
-    /**
-     * @see org.argouml.ui.NavigationListener#isNavigateForwardEnabled()
-     */
-    public boolean isNavigateForwardEnabled() {
-        return false;
+    public String formatNamespace(Object ns) {
+        return null;
     }
 
     /**
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.