svn commit: r18976 - trunk/src/argouml-app/tests/org/argouml/uml/ui: behavior/common_behavior foundation/core

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2011-01-18 13:32:54-0800
New Revision: 18976

Modified:
   trunk/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java
   trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java
   trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java
   trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java

Log:
Create empty projects for the tests.

Modified: trunk/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java?view=diff&pathrev=18976&r1=18975&r2=18976
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/ui/behavior/common_behavior/TestUMLReceptionSignalComboBoxModel.java	2011-01-18 13:32:54-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: trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java?view=diff&pathrev=18976&r1=18975&r2=18976
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLFeatureOwnerScopeCheckBox.java	2011-01-18 13:32:54-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: trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java?view=diff&pathrev=18976&r1=18975&r2=18976
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java	2011-01-18 13:32:54-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: trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java?view=diff&pathrev=18976&r1=18975&r2=18976
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	2011-01-18 13:32:54-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]);

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

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.