svn commit: r18978 - branches/BRANCH_0_32_x: . src/argouml-app src/argouml-app/src/org/argouml/kernel src/argouml-app/src/org/argouml/persistence src/argouml-app/src/org/argouml/ui src/argouml-app/src/org/argouml/ui/explorer src/argouml-app/src/org/argouml/ui/explorer/rules src/argouml-app/src/org/argouml/uml/diagram/state src/argouml-app/tests/org/argouml/model src/argouml-app/tests/org/argouml/notation src/argouml-app/tests/org/argouml/notation/providers src/argouml-app/tests/org/argouml/notation/providers/java src/argouml-app/tests/org/argouml/notation/providers/uml src/argouml-app/tests/org/argouml/profile src/argouml-app/tests/org/argouml/ui src/argouml-app/tests/org/argouml/ui/targetmanager src/argouml-app/tests/org/argouml/uml/diagram src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui src/argouml-app/tests/org/argouml/uml/ui src/argouml-ap

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2011-01-24 10:25:30-0800
New Revision: 18978

Modified:
   branches/BRANCH_0_32_x/   (props changed)
   branches/BRANCH_0_32_x/src/argouml-app/   (props changed)
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/Project.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/ProjectManager.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ModelMemberFilePersister.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/XmiFilePersister.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ZipFilePersister.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/ProjectActions.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerTree.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProjectToModel.java
   branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/uml/diagram/state/StateDiagramGraphModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestStateMachinesFactory.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/TestNotationProvider.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/TestNotationProviderFactory2.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/java/TestModelElementNameNotationJava.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/profile/   (props changed)
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/targetmanager/TestTargetManager.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/TestDiagramFactory.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui/TestUMLClassDiagram.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/AbstractTestActionAddDiagram.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionActivityGraphDiagram.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionCollaborationDiagram.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionStateDiagram.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedClassifierComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedOperationComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java
   branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/TestUMLTagDefinitionComboBoxModel.java   (props changed)
   branches/BRANCH_0_32_x/src/argouml-core-diagrams-sequence2/tests/org/argouml/sequence2/diagram/TestSequenceDiagramFactory.java
   branches/BRANCH_0_32_x/src/argouml-core-model/src/org/argouml/model/XmiReferenceRuntimeException.java   (props changed)

Log:
Merged 18967 through 18977 to the 0.32 branch.

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/Project.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/Project.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/Project.java	2011-01-24 10:25:30-0800
@@ -14,7 +14,6 @@
  * Some portions of this file were previously release using the BSD License:
  */
 
-// $Id$
 // Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
@@ -40,7 +39,6 @@
 
 package org.argouml.kernel;
 
-import java.beans.VetoableChangeSupport;
 import java.io.File;
 import java.net.URI;
 import java.util.Collection;
@@ -496,7 +494,7 @@
      * 
      * @return the Package which is the root
      * @deprecated for 0.25.4 by tfmorris - use {@link #getRoots()} to
-     *             packages/model elements which are at the top level.
+     *             get packages/model elements which are at the top level.
      *             <p>
      *             TODO: We probably need a getDefaultNamespace() method or
      *             something similar to replace some uses of this.
@@ -532,6 +530,12 @@
      * Updates the top level ModelElements for all projects. In UML2, each
      * model knows it's root elements, so this could make setRoots(...)
      * obsolete. E.g., applying a stereotype in UML2 adds a new root.
+     * 
+     * TODO: This is redundant with setRoots/getRoots.  There are already too
+     * many ways this stuff is managed without adding an additional one.
+     * All current model subsystem implementations know their top level
+     * elements.  Responsibility can be moved to the model subsystem, but
+     * let's choose *one* way of managing this.
      */
     public void updateRoots();
     

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/ProjectManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/ProjectManager.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/ProjectManager.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/kernel/ProjectManager.java	2011-01-24 10:25:30-0800
@@ -267,10 +267,8 @@
      *             renderings in diagrams use
      *             {@link org.argouml.uml.diagram.ui.ArgoFig#getSettings()}.
      */
+    @Deprecated
     public Project getCurrentProject() {
-        if (currentProject == null && !creatingCurrentProject) {
-            makeEmptyProject();
-        }
         return currentProject;
     }
     

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ModelMemberFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ModelMemberFilePersister.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ModelMemberFilePersister.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ModelMemberFilePersister.java	2011-01-24 10:25:30-0800
@@ -73,12 +73,14 @@
 class ModelMemberFilePersister extends MemberFilePersister 
     implements XmiExtensionParser {
 
-    /**
-     * Logger.
-     */
     private static final Logger LOG =
         Logger.getLogger(ModelMemberFilePersister.class);
 
+    private Object curModel;
+    private HashMap<String, Object> uUIDRefs;
+
+    private Collection elementsRead;
+    
     /**
      * Loads a model (XMI only) from a URL. BE ADVISED this
      * method has a side effect. It sets _UUIDREFS to the model.<p>
@@ -137,6 +139,7 @@
         // the listener.  Until then, do it here.
         Model.getUmlHelper().addListenersToModel(mmodel);
 
+        // TODO Add all top level packages
         project.addMember(mmodel);
 
         project.setUUIDRefs(new HashMap<String, Object>(getUUIDRefs()));
@@ -184,16 +187,13 @@
     public void parse(String label, String xmiExtensionString) {
         LOG.info("Parsing an extension for " + label);
     }
-    
-    private Object curModel;
-    private HashMap<String, Object> uUIDRefs;
-
-    private Collection elementsRead;
 
 
     /**
      * @return the current model
+     * @deprecated by tfmorris for 0.33.1
      */
+    @Deprecated
     public Object getCurModel() {
         return curModel;
     }

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/XmiFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/XmiFilePersister.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/XmiFilePersister.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/XmiFilePersister.java	2011-01-24 10:25:30-0800
@@ -263,6 +263,7 @@
             progressMgr.nextPhase();
             Model.getUmlHelper().addListenersToModel(model);
             p.setUUIDRefs(modelPersister.getUUIDRefs());
+            // TODO Handle multiple top level packages
             p.addMember(model);
             parseXmiExtensions(p);
             modelPersister.registerDiagrams(p);

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ZipFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ZipFilePersister.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ZipFilePersister.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/persistence/ZipFilePersister.java	2011-01-24 10:25:30-0800
@@ -223,6 +223,7 @@
                 new ModelMemberFilePersister();
             
             modelPersister.readModels(is);
+            // TODO Handle multiple top level packages
             Object model = modelPersister.getCurModel();
             Model.getUmlHelper().addListenersToModel(model);
             p.setUUIDRefs(modelPersister.getUUIDRefs());

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/ProjectActions.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/ProjectActions.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/ProjectActions.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/ProjectActions.java	2011-01-24 10:25:30-0800
@@ -91,8 +91,11 @@
         redoAction.setEnabled(false);
         
         TargetManager.getInstance().addTargetListener(this);
-        ProjectManager.getManager().getCurrentProject().getUndoManager()
-            .addPropertyChangeListener(this);
+        Project p = ProjectManager.getManager().getCurrentProject();
+        if (p != null) {
+            p.getUndoManager().addPropertyChangeListener(this);
+        }
+            
     }
 
     /**

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerTree.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerTree.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerTree.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerTree.java	2011-01-24 10:25:30-0800
@@ -114,10 +114,10 @@
             bgImage = ResourceLoaderWrapper.lookupIconResource(
                     "uml2explorerbg").getImage();
         }
-
-        ProjectSettings ps = p.getProjectSettings();
-        setShowStereotype(ps.getShowStereotypesValue());
-
+        if (p != null) {
+            ProjectSettings ps = p.getProjectSettings();
+            setShowStereotype(ps.getShowStereotypesValue());
+        }
         this.addMouseListener(new ExplorerMouseListener(this));
         this.addTreeSelectionListener(new ExplorerTreeSelectionListener());
         this.addTreeWillExpandListener(new ExplorerTreeWillExpandListener());

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProjectToModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProjectToModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProjectToModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProjectToModel.java	2011-01-24 10:25:30-0800
@@ -65,7 +65,7 @@
 	if (parent instanceof Project) {
 	    return ((Project) parent).getUserDefinedModelList();
 	}
-	return Collections.EMPTY_SET;
+	return Collections.emptyList();
     }
 
     /*
@@ -73,6 +73,6 @@
      */
     public Set getDependencies(Object parent) {
         // TODO: What?
-	return Collections.EMPTY_SET;
+	return Collections.emptySet();
     }
 }

Modified: branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/uml/diagram/state/StateDiagramGraphModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/uml/diagram/state/StateDiagramGraphModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/uml/diagram/state/StateDiagramGraphModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/src/org/argouml/uml/diagram/state/StateDiagramGraphModel.java	2011-01-24 10:25:30-0800
@@ -107,11 +107,11 @@
     public List getPorts(Object nodeOrEdge) {
         List res = new ArrayList();
         if (Model.getFacade().isAState(nodeOrEdge)) {
-	    res.add(nodeOrEdge);
-	}
+            res.add(nodeOrEdge);
+        }
         if (Model.getFacade().isAPseudostate(nodeOrEdge)) {
-	    res.add(nodeOrEdge);
-	}
+            res.add(nodeOrEdge);
+        }
         return res;
     }
 
@@ -127,8 +127,8 @@
      */
     public List getInEdges(Object port) {
         if (Model.getFacade().isAStateVertex(port)) {
-	    return new ArrayList(Model.getFacade().getIncomings(port));
-	}
+            return new ArrayList(Model.getFacade().getIncomings(port));
+        }
         LOG.debug("TODO: getInEdges of MState");
         return Collections.EMPTY_LIST;
     }
@@ -138,8 +138,8 @@
      */
     public List getOutEdges(Object port) {
         if (Model.getFacade().isAStateVertex(port)) {
-	    return new ArrayList(Model.getFacade().getOutgoings(port));
-	}
+            return new ArrayList(Model.getFacade().getOutgoings(port));
+        }
         LOG.debug("TODO: getOutEdges of MState");
         return Collections.EMPTY_LIST;
     }
@@ -195,7 +195,10 @@
         Object end0 = null;
         Object end1 = null;
 
-        if (edge instanceof CommentEdge) {
+        if (Model.getFacade().isATransition(edge)) {
+            end0 = Model.getFacade().getSource(edge);
+            end1 = Model.getFacade().getTarget(edge);
+        } else if (edge instanceof CommentEdge) {
             end0 = ((CommentEdge) edge).getSource();
             end1 = ((CommentEdge) edge).getDestination();
         } else {
@@ -329,17 +332,17 @@
      *      java.lang.Object, java.lang.Class)
      */
     public Object connect(Object fromPort, Object toPort,
-			  Object edgeClass) {
+                          Object edgeClass) {
 
         if (Model.getFacade().isAFinalState(fromPort)) {
-	    return null;
-	}
+            return null;
+        }
 
         if (Model.getFacade().isAPseudostate(toPort)
                 && Model.getPseudostateKind().getInitial().equals(
-			Model.getFacade().getKind(toPort))) {
+                        Model.getFacade().getKind(toPort))) {
             return null;
-	}
+        }
 
         if (Model.getMetaTypes().getTransition().equals(edgeClass)) {
             Object tr = null;
@@ -426,10 +429,10 @@
 
         // check parameter types:
         if (!(Model.getFacade().isAState(newNode)
-	      || Model.getFacade().isAState(oldNode)
-	      || Model.getFacade().isATransition(edge))) {
-	    return false;
-	}
+              || Model.getFacade().isAState(oldNode)
+              || Model.getFacade().isATransition(edge))) {
+            return false;
+        }
 
         // it's not allowed to move a transition
         // so that it will go from a composite to its substate

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java	2011-01-24 10:25:30-0800
@@ -57,6 +57,7 @@
  */
 public class TestModelEventPump extends TestCase {
     private Object elem;
+    private Object model;
     private boolean eventcalled;
     private TestListener listener;
 
@@ -98,8 +99,7 @@
 
         elem = Model.getCoreFactory().createClass();
         new InitProfileSubsystem().init();
-        Project project = ProjectManager.getManager().getCurrentProject();
-        Object model = project.getRoot();
+        model = Model.getModelManagementFactory().createModel();
         Model.getCoreHelper().addOwnedElement(model, elem);
         eventcalled = false;
         listener = new TestListener();
@@ -114,6 +114,10 @@
         ProfileFacade.reset();
         if (elem != null) {
             Model.getUmlFactory().delete(elem);
+            elem = null;
+
+            Model.getUmlFactory().delete(model);
+            model = null;
         }
         listener = null;
         super.tearDown();

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestStateMachinesFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestStateMachinesFactory.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestStateMachinesFactory.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/model/TestStateMachinesFactory.java	2011-01-24 10:25:30-0800
@@ -44,8 +44,6 @@
 
 import junit.framework.TestCase;
 
-import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -137,11 +135,10 @@
      */
     public void testDeleteTransition()  {
         new InitProfileSubsystem().init();
-        Project p = ProjectManager.getManager().getCurrentProject();
         Object model =
             Model.getModelManagementFactory().createModel();
         aClass = Model.getCoreFactory().buildClass(model);
-        Object returnType = p.getDefaultReturnType();
+        Object returnType = null;
         Model.getCoreFactory().buildOperation2(aClass, returnType, "myOper");
         aStateMachine =
             Model.getStateMachinesFactory().buildStateMachine(aClass);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/TestNotationProvider.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/TestNotationProvider.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/TestNotationProvider.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/TestNotationProvider.java	2011-01-24 10:25:30-0800
@@ -110,8 +110,6 @@
     public void testListener() throws InterruptedException {
         Object model =
             Model.getModelManagementFactory().createModel();
-        Project p = ProjectManager.getManager().getCurrentProject();
-        p.addModel(model);
         aClass = Model.getCoreFactory().buildClass(model);
         
         NotationProvider np = new NPImpl();

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/TestNotationProviderFactory2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/TestNotationProviderFactory2.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/TestNotationProviderFactory2.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/TestNotationProviderFactory2.java	2011-01-24 10:25:30-0800
@@ -78,7 +78,7 @@
                     null,
                     ResourceLoaderWrapper.lookupIconResource("JavaNotation"));
         Notation.setDefaultNotation(name);
-        proj = ProjectManager.getManager().getCurrentProject();
+        proj = ProjectManager.getManager().makeEmptyProject(true);
         proj.getProjectSettings().setNotationLanguage(name);
     }
 

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/java/TestModelElementNameNotationJava.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/java/TestModelElementNameNotationJava.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/java/TestModelElementNameNotationJava.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/java/TestModelElementNameNotationJava.java	2011-01-24 10:25:30-0800
@@ -54,11 +54,17 @@
  */
 public class TestModelElementNameNotationJava extends TestCase {
     private Object theClass;
+    private Object model;
+
+    private Object getModel() {
+        return model;
+    }
 
     protected void setUp() throws Exception {
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        model = Model.getModelManagementFactory().createModel();
         theClass = Model.getCoreFactory().buildClass("TheClass", getModel());
     }
     
@@ -145,10 +151,6 @@
         assertToStringForNamedRelationshipEqualsItsName(generalization);
     }
 
-    private Object getModel() {
-        return ProjectManager.getManager().getCurrentProject().getModel();
-    }
-
     /**
      * Test if help is correctly provided.
      */

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	2011-01-24 10:25:30-0800
@@ -79,8 +79,6 @@
         new InitProfileSubsystem().init();
         Object model =
             Model.getModelManagementFactory().createModel();
-        Project p = ProjectManager.getManager().getCurrentProject();
-        p.addModel(model);
         aClass = Model.getCoreFactory().buildClass(model);
         aStateMachine =
             Model.getStateMachinesFactory().buildStateMachine(aClass);
@@ -95,8 +93,6 @@
     
     @Override
     protected void tearDown() throws Exception {
-        ProjectManager.getManager().removeProject(
-                ProjectManager.getManager().getCurrentProject());
         ProfileFacade.reset();
         super.tearDown();
     }
@@ -188,8 +184,7 @@
     public void testActionType() {
         ActionStateNotationUml notation = 
             new ActionStateNotationUml(aActionState);
-        Project p = ProjectManager.getManager().getCurrentProject();
-        Object returnType = p.getDefaultReturnType();
+        Object returnType = null;
         aOper = Model.getCoreFactory().buildOperation2(aClass, returnType,
             "testUA");
         notation.parse(aActionState, "testUA()");

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java	2011-01-24 10:25:30-0800
@@ -80,7 +80,7 @@
         new InitProfileSubsystem().init();
         Object model =
             Model.getModelManagementFactory().createModel();
-        Project p = ProjectManager.getManager().getCurrentProject();
+        Project p = ProjectManager.getManager().makeEmptyProject(true);
         p.addModel(model);
         aClass = Model.getCoreFactory().buildClass(model);
         aClass2 = Model.getCoreFactory().buildClass(model);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java	2011-01-24 10:25:30-0800
@@ -82,6 +82,7 @@
 	super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        ProjectManager.getManager().makeEmptyProject();
     }
     
 

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java	2011-01-24 10:25:30-0800
@@ -95,6 +95,7 @@
         (new InitNotationUml()).init();
         
         npSettings = new SDNotationSettings();
+        ProjectManager.getManager().makeEmptyProject();
     }
 
     

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	2011-01-24 10:25:30-0800
@@ -43,7 +43,6 @@
 
 import junit.framework.TestCase;
 
-import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
@@ -79,9 +78,9 @@
         new InitProfileSubsystem().init();
         Object model =
             Model.getModelManagementFactory().createModel();
-        Project p = ProjectManager.getManager().getCurrentProject();
+        ProjectManager.getManager().makeEmptyProject(true);
         aClass = Model.getCoreFactory().buildClass(model);
-        Object returnType = p.getDefaultReturnType();
+        Object returnType = null;
         Model.getCoreFactory().buildOperation2(aClass, returnType, "myOper");
         aStateMachine =
             Model.getStateMachinesFactory().buildStateMachine(aClass);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	2011-01-24 10:25:30-0800
@@ -81,12 +81,14 @@
         InitializeModel.initializeDefault();
         assertTrue("Model subsystem init failed.", Model.isInitiated());
         new InitProfileSubsystem().init();
-        Project p = ProjectManager.getManager().getCurrentProject();
+        Project p = ProjectManager.getManager().makeEmptyProject();
         returnType = p.getDefaultReturnType();
 
         model = Model.getModelManagementFactory().createModel();
         aClass = Model.getCoreFactory().buildClass("A", model);
-        aOper = Model.getCoreFactory().buildOperation2(aClass, returnType, "myOper");
+        aOper = 
+            Model.getCoreFactory().buildOperation2(
+                    aClass, returnType, "myOper");
         aStateMachine =
             Model.getStateMachinesFactory().buildStateMachine(aClass);
         Object top = Model.getFacade().getTop(aStateMachine);
@@ -117,7 +119,8 @@
         Object trigger2s = Model.getFacade().getTrigger(t2s);
         Object trigger3s = Model.getFacade().getTrigger(t3s);
         assertTrue("No reuse of a signal event.", trigger1s == trigger2s);
-        assertTrue("Unexpected reuse of a signal event.",  trigger1s != trigger3s);
+        assertTrue("Unexpected reuse of a signal event.",
+                trigger1s != trigger3s);
         
         // reuse call event:
         Object t1c = checkGenerated(aState, "trigger1()[guard]/effect", 
@@ -156,7 +159,8 @@
         Object trigger2g = Model.getFacade().getTrigger(t2g);
         Object trigger3g = Model.getFacade().getTrigger(t3g);
         assertTrue("No reuse of a change event.", trigger1g == trigger2g);
-        assertTrue("Unexpected reuse of a change event.", trigger1g != trigger3g);
+        assertTrue("Unexpected reuse of a change event.", 
+                trigger1g != trigger3g);
     }
 
     /**
@@ -458,7 +462,9 @@
         Object aPack = Model.getModelManagementFactory().buildPackage("pack1");
         Model.getCoreHelper().setNamespace(aPack, model);
         aClass = Model.getCoreFactory().buildClass("A", aPack);
-        aOper = Model.getCoreFactory().buildOperation2(aClass, returnType, "myOper");
+        aOper = 
+            Model.getCoreFactory().buildOperation2(
+                    aClass, returnType, "myOper");
         aStateMachine =
             Model.getActivityGraphsFactory().buildActivityGraph(aPack);
        
@@ -525,7 +531,8 @@
     /**
      * This method only uses the "aState" variable.
      */
-    private void checkLinkingOfOperationToCallEvent(String text, Object operation) {
+    private void checkLinkingOfOperationToCallEvent(
+            String text, Object operation) {
         Object trans;
         Object trig;
         Object myOp;

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java	2011-01-24 10:25:30-0800
@@ -47,6 +47,8 @@
 import org.argouml.cognitive.checklist.ui.InitCheckListUI;
 import org.argouml.cognitive.ui.InitCognitiveUI;
 import org.argouml.cognitive.ui.TabToDo;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -70,6 +72,8 @@
  */
 public class TestDetailsPane extends TestCase {
 
+    private Project project;
+
     /**
      * @param arg0 is the name of the test case.
      */
@@ -84,6 +88,9 @@
 	super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        
+        project = ProjectManager.getManager().makeEmptyProject();
+
         new InitUmlUI().init();
         new InitCheckListUI().init();
         new InitCognitiveUI().init();
@@ -96,15 +103,24 @@
         (new InitUseCaseDiagram()).init();
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(project);
+        super.tearDown();
+    }
+
     /**
      * Test setting a target.
+     * 
+     * @exception Exception if the intTestTargetSet() encounters an error.
      */
     public void testTargetSet() throws Exception {
         // Make sure this test happens on the AWT event thread
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 intTestTargetSet();
-            }});
+            }
+        });
     }
     
     /**

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/targetmanager/TestTargetManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/targetmanager/TestTargetManager.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/targetmanager/TestTargetManager.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/ui/targetmanager/TestTargetManager.java	2011-01-24 10:25:30-0800
@@ -80,6 +80,7 @@
     private Fig     targetRemovedFigTarget;
     private Object  targetRemovedModelTarget;
     private Object  targetRemovedObjects[];
+    private Project project;
 
     private class TestTargetListener implements TargetListener {
 
@@ -470,8 +471,9 @@
 	Object test = new Object();
 	ArgoDiagram diag = new ArgoDiagramImpl() {
 	    public Fig getContainingFig(Object obj) {
-		if (obj == owner)
+		if (obj == owner) {
 		    return fig;
+		}
 		return null;
 	    }
 	    public void encloserChanged(FigNode enclosed, 
@@ -581,8 +583,12 @@
 	Object test = new Object();
 
 	List<Object> list1 = new ArrayList<Object>();
-	List<Object> list2 = new ArrayList<Object>(); list2.add(test);
-	List<Object> list3 = new ArrayList<Object>(); list3.add(fig); list3.add(test);
+	
+	List<Object> list2 = new ArrayList<Object>(); 
+	list2.add(test);
+	
+	List<Object> list3 = new ArrayList<Object>(); 
+	list3.add(fig); list3.add(test);
 
 	TargetListener listener = new TestTargetListener();
 	TargetManager.getInstance().addTargetListener(listener);
@@ -907,6 +913,8 @@
     protected void setUp() {
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        
+        project = ProjectManager.getManager().makeEmptyProject();
 
 	TargetManager.getInstance().setTarget(null);
     }
@@ -916,5 +924,6 @@
      */
     protected void tearDown() {
 	TargetManager.getInstance().setTarget(null);
+	ProjectManager.getManager().removeProject(project);
     }
 }

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/TestDiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/TestDiagramFactory.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/TestDiagramFactory.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/TestDiagramFactory.java	2011-01-24 10:25:30-0800
@@ -39,6 +39,8 @@
 package org.argouml.uml.diagram;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -55,11 +57,20 @@
 
     private static final Logger LOG = 
         Logger.getLogger(TestDiagramFactory.class);
+    private Project project;
     
     protected void setUp() throws Exception {
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        
+        project = ProjectManager.getManager().makeEmptyProject();
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(project);
+        super.tearDown();
     }
 
     /**
@@ -90,7 +101,8 @@
             ArgoDiagram diagram;
             if (type == DiagramType.Sequence) {
                 // TODO: Fix this so that new sequence diagrams are tested
-                LOG.warn("Skipping Sequence Diagram test because they are in a separate module");
+                LOG.warn("Skipping Sequence Diagram test " 
+                         + "because they are in a separate module");
                 return;
             } else if (type == DiagramType.State) {
                 Object context = Model.getCoreFactory().buildClass(model);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui/TestUMLClassDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui/TestUMLClassDiagram.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui/TestUMLClassDiagram.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/diagram/static_structure/ui/TestUMLClassDiagram.java	2011-01-24 10:25:30-0800
@@ -42,6 +42,8 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.InitNotation;
@@ -58,6 +60,7 @@
 public class TestUMLClassDiagram extends TestCase {
 
     private static Object[] nodeTypes;
+    private Project project;
 
     /**
      * The constructor.
@@ -80,6 +83,9 @@
 
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        
+        project = ProjectManager.getManager().makeEmptyProject();
+        
         nodeTypes =
                 new Object[] {
                         Model.getCoreFactory().createClass(),
@@ -103,6 +109,11 @@
                 };
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(project);
+        super.tearDown();
+    }
     /**
      * Test the UMLClassDiagram empty constructor. The graph model should always
      * be a ClassDiagramGraphModel

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/AbstractTestActionAddDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/AbstractTestActionAddDiagram.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/AbstractTestActionAddDiagram.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/AbstractTestActionAddDiagram.java	2011-01-24 10:25:30-0800
@@ -43,6 +43,8 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.InitNotation;
@@ -74,6 +76,8 @@
      */
     private List validNamespaces;
 
+    private Project project;
+
     /**
      * Constructor for AbstractTestActionAddDiagram.
      * @param arg0 test case name
@@ -92,6 +96,8 @@
         (new InitNotationJava()).init();
         (new InitProfileSubsystem()).init();
 
+        project = ProjectManager.getManager().makeEmptyProject();
+
 	action = getAction();
 
 	ns = getNamespace();
@@ -105,6 +111,8 @@
         action = null;
         ns = null;
         validNamespaces = null;
+
+        ProjectManager.getManager().removeProject(project);
     }
 
     /**

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionActivityGraphDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionActivityGraphDiagram.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionActivityGraphDiagram.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionActivityGraphDiagram.java	2011-01-24 10:25:30-0800
@@ -42,6 +42,8 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -65,6 +67,8 @@
      */
     private Object ns;
 
+    private Project project;
+
     
     /**
      * Constructor.
@@ -89,6 +93,7 @@
 
     @Override
     protected void setUp() {
+        project = ProjectManager.getManager().makeEmptyProject();
         action = getAction();
         ns = getNamespace();
         TargetManager.getInstance().setTarget(ns);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionCollaborationDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionCollaborationDiagram.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionCollaborationDiagram.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionCollaborationDiagram.java	2011-01-24 10:25:30-0800
@@ -44,6 +44,8 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -77,6 +79,8 @@
      */
     private List validNamespaces;
 
+    private Project project;
+
     /**
      * Constructor for TestActionCollaborationDiagram.
      * @param arg0 name of the test case
@@ -117,6 +121,9 @@
     protected void setUp() {
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        
+        project = ProjectManager.getManager().makeEmptyProject();
+
         action = getAction();
         ns = getNamespace();
         validNamespaces = getValidNamespaceClasses();
@@ -124,6 +131,10 @@
         TargetManager.getInstance().setTarget(ns);
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
     /**
      * Test if the namespace is correct for the diagram.<p>
      *

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionStateDiagram.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionStateDiagram.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/TestActionStateDiagram.java	2011-01-24 10:25:30-0800
@@ -44,6 +44,7 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -127,6 +128,8 @@
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() {
+        ProjectManager.getManager().makeEmptyProject();
+
         action = getAction();
         ns = getNamespace();
         validNamespaces = getValidNamespaceClasses();

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -97,7 +97,7 @@
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
 
-        Project p = ProjectManager.getManager().getCurrentProject();
+        Project p = ProjectManager.getManager().makeEmptyProject();
         model = new UMLAssociationRoleBaseComboBoxModel();
         Object class1 = Model.getCoreFactory().createClass();
         Object class2 = Model.getCoreFactory().createClass();

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedClassifierComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedClassifierComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedClassifierComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedClassifierComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -86,14 +86,15 @@
     protected void setUp() throws Exception {
         super.setUp();
 
+        Project p = ProjectManager.getManager().makeEmptyProject();
+
         elem = Model.getCollaborationsFactory().createCollaboration();
         Model.getCoreHelper().setName(elem, "collaboration elem");
         model = new UMLCollaborationRepresentedClassifierComboBoxModel();
         TargetManager.getInstance().setTarget(elem);
         ThreadHelper.synchronize();
         
-        Project p = ProjectManager.getManager().getCurrentProject();
-        Object m = p.getRoot();
+        Object m = p.getRoots().iterator().next();
         clazz = Model.getCoreFactory().buildClass(m);
         Model.getCoreHelper().setName(clazz, "clazz");
         Model.getCollaborationsHelper().setRepresentedClassifier(elem, clazz);
@@ -126,6 +127,7 @@
 
     /**
      * Test removing the represented operation.
+     * @throws Exception if we were interrupted waiting for the awt thread.
      */
     public void testExtraRepresentedOperation() throws Exception {
 	Object cl2 = Model.getCoreFactory().createClass();

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedOperationComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedOperationComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLCollaborationRepresentedOperationComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -38,13 +38,11 @@
 
 package org.argouml.uml.ui.behavior.collaborations;
 
-import java.lang.reflect.InvocationTargetException;
-
 import junit.framework.TestCase;
-import org.argouml.model.InitializeModel;
 
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
+import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
 import org.argouml.ui.targetmanager.TargetEvent;
@@ -79,13 +77,14 @@
     protected void setUp() throws Exception {
         super.setUp();
 
+        Project p = ProjectManager.getManager().makeEmptyProject();
+
         elem = Model.getCollaborationsFactory().createCollaboration();
         model = new UMLCollaborationRepresentedOperationComboBoxModel();
         TargetManager.getInstance().setTarget(elem);
         ThreadHelper.synchronize();
         
-        Project p = ProjectManager.getManager().getCurrentProject();
-        Object m = p.getRoot();
+        Object m = p.getRoots().iterator().next();
         Object clazz = Model.getCoreFactory().buildClass(m);
         oper = Model.getCoreFactory().createOperation();
         Model.getCoreHelper().setOwner(oper, clazz);
@@ -119,8 +118,11 @@
 
     /**
      * Test removing the represented operation.
+     * 
+     * @throws Exception interupted by awt thread.
      */
     public void testExtraRepresentedOperation() throws Exception {
+        assertEquals(2, model.getSize());
         Object op = Model.getCoreFactory().createOperation();
         Model.getCollaborationsHelper().setRepresentedOperation(elem, op);
         /* Simulate a target change. */

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -78,6 +78,8 @@
      */
     private Object elem;
 
+    private Project project;
+
     /**
      * Constructor for TestUMLReceptionSignalComboBoxModel.
      *
@@ -96,13 +98,13 @@
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
-        Project p = ProjectManager.getManager().getCurrentProject();
+        project = ProjectManager.getManager().makeEmptyProject();
         elem = Model.getCommonBehaviorFactory().createReception();
         signals = new Object[NO_OF_ELEMENTS];
         Object m = Model.getModelManagementFactory().createModel();
         Collection roots = new ArrayList();
         roots.add(m);
-        p.setRoots(roots);
+        project.setRoots(roots);
         Model.getCoreHelper().setNamespace(elem, m);
         for (int i = 0; i < NO_OF_ELEMENTS; i++) {
             signals[i] = Model.getCommonBehaviorFactory().createSignal();
@@ -125,6 +127,7 @@
             Model.getUmlFactory().delete(signals[i]);
         }
         model = null;
+        ProjectManager.getManager().removeProject(project);
     }
 
     /**

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java	2011-01-24 10:25:30-0800
@@ -39,6 +39,9 @@
 package org.argouml.uml.ui.foundation.core;
 
 import junit.framework.TestCase;
+
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 
 import org.argouml.model.Model;
@@ -60,6 +63,8 @@
      */
     private Object elem;
 
+    private Project project;
+
     /**
      * Constructor for TestUMLFeatureOwnerScopeCheckBox.
      * @param arg0 is the name of the test case.
@@ -75,6 +80,7 @@
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        project = ProjectManager.getManager().makeEmptyProject(); 
         elem = Model.getCoreFactory().createAttribute();
 
 	box = new UMLFeatureOwnerScopeCheckBox();
@@ -90,6 +96,7 @@
         Model.getUmlFactory().delete(elem);
         elem = null;
         box = null;
+        ProjectManager.getManager().removeProject(project);
     }
 
     /**

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -45,6 +45,7 @@
 import org.argouml.model.InitializeModel;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
@@ -92,6 +93,8 @@
      */
     private Object namespace;
 
+    private Project project;
+
     /**
      * Logger.
      */
@@ -114,6 +117,7 @@
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+        project = ProjectManager.getManager().makeEmptyProject();
         Object mmodel =
             Model.getModelManagementFactory().createModel();
         Model.getCoreHelper().setName(mmodel, "untitledModel");
@@ -143,6 +147,8 @@
 
     /*
      * @see junit.framework.TestCase#tearDown()
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     @Override
     protected void tearDown() throws Exception {
@@ -155,10 +161,13 @@
             Model.getUmlFactory().delete(types[i]);
         }
         model = null;
+        ProjectManager.getManager().removeProject(project);
     }
 
     /**
      * Test setup.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetUp() throws Exception {
         ThreadHelper.synchronize();
@@ -169,6 +178,8 @@
 
     /**
      * Test setPowertype().
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetPowertype() throws Exception {
         LOG.info("Setting powertype");
@@ -189,6 +200,8 @@
 
     /**
      * Test setPowertype() with null argument.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetPowertypeToNull() throws Exception {
         Model.getCoreHelper().setPowertype(elem, types[0]);
@@ -208,6 +221,8 @@
 
     /**
      * Test deletion.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testRemovePowertype() throws Exception {
         Model.getUmlFactory().delete(types[NO_OF_ELEMENTS - 1]);

Modified: branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	2011-01-24 10:25:30-0800
@@ -43,6 +43,7 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
@@ -78,6 +79,8 @@
     
     private Object dummy;
 
+    private Project project;
+
     /**
      * Constructor for TestUMLStructuralFeatureTypeComboBoxModel.
      * @param arg0 is the name of the test case.
@@ -94,6 +97,9 @@
         super.setUp();
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
+
+        project = ProjectManager.getManager().makeEmptyProject();
+        
         Object mmodel =
             Model.getModelManagementFactory().createModel();
         Model.getCoreHelper().setName(mmodel, "untitledModel");
@@ -128,10 +134,13 @@
             Model.getUmlFactory().delete(types[i]);
         }
         model = null;
+        ProjectManager.getManager().removeProject(project);
     }
 
     /**
      * Test the test set up.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetUp() throws Exception {
         ThreadHelper.synchronize();
@@ -154,6 +163,8 @@
 
     /**
      * Test the setType function.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetType() throws Exception {
         Model.getCoreHelper().setType(elem, types[0]);
@@ -167,6 +178,8 @@
      * the model cannot present null types. therefore until
      * the combobox model is changed itself, we test for
      * a not null value.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testSetTypeToNull() throws Exception {
         Model.getCoreHelper().setType(elem, types[0]);
@@ -177,6 +190,8 @@
 
     /**
      * The test for removing types.
+     * 
+     * @throws Exception If interrupted no awk thread.
      */
     public void testRemoveType() throws Exception {
         Model.getUmlFactory().delete(types[NO_OF_ELEMENTS - 1]);

Modified: branches/BRANCH_0_32_x/src/argouml-core-diagrams-sequence2/tests/org/argouml/sequence2/diagram/TestSequenceDiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_32_x/src/argouml-core-diagrams-sequence2/tests/org/argouml/sequence2/diagram/TestSequenceDiagramFactory.java?view=diff&pathrev=18978&r1=18977&r2=18978
==============================================================================
--- branches/BRANCH_0_32_x/src/argouml-core-diagrams-sequence2/tests/org/argouml/sequence2/diagram/TestSequenceDiagramFactory.java	(original)
+++ branches/BRANCH_0_32_x/src/argouml-core-diagrams-sequence2/tests/org/argouml/sequence2/diagram/TestSequenceDiagramFactory.java	2011-01-24 10:25:30-0800
@@ -39,15 +39,15 @@
 package org.argouml.sequence2.diagram;
 
 
+import junit.framework.TestCase;
+
+import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.profile.init.InitProfileSubsystem;
-import org.argouml.sequence2.diagram.SequenceDiagramFactory;
 import org.argouml.uml.diagram.ArgoDiagram;
 
-import junit.framework.TestCase;
-
 /**
  * Tests the TestSequenceDiagramFactory class.
  * @author penyaskito
@@ -56,11 +56,20 @@
 
     private Class sequence2DiagramClass = 
         org.argouml.sequence2.diagram.UMLSequenceDiagram.class;
+    private Project project;
         
     protected void setUp() throws Exception {        
         super.setUp();
         InitializeModel.initializeDefault();
         (new InitProfileSubsystem()).init();
+
+        project = ProjectManager.getManager().makeEmptyProject();
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(project);
+        super.tearDown();
     }
     
     /**


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

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.