Author: maurelio1234
Date: 2007-08-14 11:05:36-0700
New Revision: 13343
Added:
branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/FakeProfile.java
Modified:
branches/gsoc2007/maurelio1234/branch2/tests/.classpath
branches/gsoc2007/maurelio1234/branch2/tests/Model all tests.launch
branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java
branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java
branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java
Log:
removing code using deprecated profiles API
implementing "appliedProfile" semantics
updating tests
Modified: branches/gsoc2007/maurelio1234/branch2/tests/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/.classpath?view=diff&rev=13343&p1=branches/gsoc2007/maurelio1234/branch2/tests/.classpath&p2=branches/gsoc2007/maurelio1234/branch2/tests/.classpath&r1=13342&r2=13343
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/tests/.classpath (original)
+++ branches/gsoc2007/maurelio1234/branch2/tests/.classpath 2007-08-14 11:05:36-0700
@@ -2,10 +2,10 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry excluding=".settings/|bin/|build-eclipse/|src/" kind="src" path=""/>
- <classpathentry combineaccessrules="false" kind="src" path="/argouml"/>
<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model"/>
<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-lib"/>
<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-tools"/>
<classpathentry kind="lib" path="/argouml-core-tools/jdepend-2.9/lib/jdepend-2.9.jar" sourcepath="/argouml-core-tools/jdepend-2.9/src/"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/argouml_branch"/>
<classpathentry kind="output" path="build-eclipse"/>
</classpath>
Modified: branches/gsoc2007/maurelio1234/branch2/tests/Model all tests.launch
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/Model%20all%20tests.launch?view=diff&rev=13343&p1=branches/gsoc2007/maurelio1234/branch2/tests/Model%20all%20tests.launch&p2=branches/gsoc2007/maurelio1234/branch2/tests/Model%20all%20tests.launch&r1=13342&r2=13343
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/tests/Model all tests.launch (original)
+++ branches/gsoc2007/maurelio1234/branch2/tests/Model all tests.launch 2007-08-14 11:05:36-0700
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/argouml-core-tests/org/argouml/model/AllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.model.AllTests"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="argouml-core-tests" path="1" type="4"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry path="3" projectName="argouml-core-model-mdr" type="1"/> "/>
@@ -26,9 +33,8 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/argouml-core-tools/lib/easymock12.jar" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="argouml-core-tests"/> </runtimeClasspathEntry> "/>
</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.model.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="argouml-core-tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx64M -Dtest.model.uml=${resource_loc:/argouml-core-model-mdr/src/org/argouml/model/mdr/mof/01-02-15.xml} -Dlog4j.configuration=${resource_loc:/argouml/org/argouml/resource/default_console.lcf} -Djava.awt.headless="true" -Dargouml.tests.dir=${project_loc}"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx64M -Dtest.model.uml=${resource_loc:/argouml-core-model-mdr/src/org/argouml/model/mdr/mof/01-02-15.xml} -Dlog4j.configuration=${resource_loc:/argouml_branch/org/argouml/resource/default_console.lcf} -Djava.awt.headless="true" -Dargouml.tests.dir=${project_loc}"/>
</launchConfiguration>
Added: branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/FakeProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/FakeProfile.java?view=auto&rev=13343
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/FakeProfile.java 2007-08-14 11:05:36-0700
@@ -0,0 +1,94 @@
+package org.argouml.uml.profile;
+
+import java.awt.Image;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.argouml.model.Model;
+
+/**
+ * This class simulates a real profile, containing a model and some strategies
+ *
+ * @author Marcos Aurélio
+ */
+public class FakeProfile extends Profile {
+ @SuppressWarnings("unchecked")
+ private Collection model = null;
+ private FigNodeStrategy figNodeStrategy = null;
+ private FormatingStrategy formatStrategy = null;
+
+ /**
+ * This class simulates a FigNodeStrategy
+ *
+ * @author Marcos Aurélio
+ */
+ private class FakeFigNodeStrategy implements FigNodeStrategy {
+
+ public Image getIconForStereotype(Object stereotype) {
+ return null;
+ }
+
+ }
+
+ /**
+ * This class simulates a FormatingStrategy
+ *
+ * @author Marcos Aurélio
+ */
+ private class FakeFormatingStrategy implements FormatingStrategy {
+
+ @SuppressWarnings("unchecked")
+ public String formatCollection(Iterator iter, Object namespace) {
+ return "";
+ }
+
+ public String formatElement(Object element, Object namespace) {
+ return "";
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public FakeProfile() {
+ model = new ArrayList();
+ model.add(Model.getModelManagementFactory().createModel());
+ figNodeStrategy = new FakeFigNodeStrategy();
+ formatStrategy = new FakeFormatingStrategy();
+ }
+
+ public String getDisplayName() {
+ return toString();
+ }
+
+ public FigNodeStrategy getFigureStrategy() {
+ return figNodeStrategy;
+ }
+
+ public FormatingStrategy getFormatingStrategy() {
+ return formatStrategy;
+ }
+
+ public FigNodeStrategy getFigNodeStrategy() {
+ return figNodeStrategy;
+ }
+
+ public void setFigNodeStrategy(FigNodeStrategy figNodeStrategy) {
+ this.figNodeStrategy = figNodeStrategy;
+ }
+
+ public FormatingStrategy getFormatStrategy() {
+ return formatStrategy;
+ }
+
+ public void setFormatStrategy(FormatingStrategy formatStrategy) {
+ this.formatStrategy = formatStrategy;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Collection getProfilePackages() throws ProfileException {
+ return new ArrayList();
+ }
+
+}
Modified: branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java?view=diff&rev=13343&p1=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java&p2=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java&r1=13342&r2=13343
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration1.java 2007-08-14 11:05:36-0700
@@ -24,8 +24,6 @@
package org.argouml.uml.profile;
-import java.io.File;
-
import junit.framework.TestCase;
import org.argouml.kernel.Project;
@@ -80,7 +78,7 @@
public void testAddingNewProfile() {
Project p = new ProjectImpl();
ProfileConfiguration pc = new ProfileConfiguration(p);
- Profile pr = new UserDefinedProfile(new File("someprofile"));
+ Profile pr = new FakeProfile();
pc.addProfile(pr);
assertTrue("Profile was not correctly added to the configuration!", pc
@@ -94,7 +92,7 @@
public void testRemovingProfile() {
Project p = new ProjectImpl();
ProfileConfiguration pc = new ProfileConfiguration(p);
- Profile pr = new UserDefinedProfile(new File("someprofile"));
+ Profile pr = new FakeProfile();
if (!pc.getProfiles().contains(pr)) {
pc.addProfile(pr);
@@ -112,7 +110,7 @@
public void testRemovingUnknownProfile() {
Project p = new ProjectImpl();
ProfileConfiguration pc = new ProfileConfiguration(p);
- Profile pr = new UserDefinedProfile(new File("someprofile"));
+ Profile pr = new FakeProfile();
if (!pc.getProfiles().contains(pr)) {
pc.removeProfile(pr);
Modified: branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java?view=diff&rev=13343&p1=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java&p2=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java&r1=13342&r2=13343
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileConfiguration2.java 2007-08-14 11:05:36-0700
@@ -24,20 +24,11 @@
package org.argouml.uml.profile;
-import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.swing.ImageIcon;
-
import junit.framework.TestCase;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectImpl;
import org.argouml.model.InitializeModel;
-import org.argouml.model.Model;
/**
* Tests the handling of the strategies and models provided by the installed
@@ -63,91 +54,6 @@
InitializeModel.initializeDefault();
}
- /**
- * This class simulates a real profile, containing a model and
- * some strategies
- *
- * @author Marcos Aurélio
- */
- private class FakeProfile extends Profile {
- private Object model = null;
- private FigNodeStrategy figNodeStrategy = null;
- private FormatingStrategy formatStrategy = null;
-
- public FakeProfile() {
- model = Model.getModelManagementFactory().createModel();
- figNodeStrategy = new FakeFigNodeStrategy();
- formatStrategy = new FakeFormatingStrategy();
- }
-
- public String getDisplayName() {
- return toString();
- }
-
- public FigNodeStrategy getFigureStrategy() {
- return figNodeStrategy;
- }
-
- public FormatingStrategy getFormatingStrategy() {
- return formatStrategy;
- }
-
- public Object getModel() {
- return model;
- }
-
- public FigNodeStrategy getFigNodeStrategy() {
- return figNodeStrategy;
- }
-
- public void setFigNodeStrategy(FigNodeStrategy figNodeStrategy) {
- this.figNodeStrategy = figNodeStrategy;
- }
-
- public FormatingStrategy getFormatStrategy() {
- return formatStrategy;
- }
-
- public void setFormatStrategy(FormatingStrategy formatStrategy) {
- this.formatStrategy = formatStrategy;
- }
-
- @Override
- public Collection getProfilePackages() throws ProfileException {
- return new ArrayList();
- }
-
- }
-
- /**
- * This class simulates a FigNodeStrategy
- *
- * @author Marcos Aurélio
- */
- private class FakeFigNodeStrategy implements FigNodeStrategy {
-
- public Image getIconForStereotype(Object stereotype) {
- return null;
- }
-
- }
-
- /**
- * This class simulates a FormatingStrategy
- *
- * @author Marcos Aurélio
- */
- private class FakeFormatingStrategy implements FormatingStrategy {
-
- public String formatCollection(Iterator iter, Object namespace) {
- return "";
- }
-
- public String formatElement(Object element, Object namespace) {
- return "";
- }
-
- }
/**
* Whether a formating strategy can be property activated
Modified: branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java?view=diff&rev=13343&p1=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java&p2=branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java&r1=13342&r2=13343
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/tests/org/argouml/uml/profile/TestProfileManagerImpl.java 2007-08-14 11:05:36-0700
@@ -24,8 +24,6 @@
package org.argouml.uml.profile;
-import java.io.File;
-
import junit.framework.TestCase;
/**
@@ -47,7 +45,7 @@
* Test whether the ProfileManager can register a new profile
*/
public void testRegisterProfile() {
- Profile profile = new UserDefinedProfile(new File("someprofile"));
+ Profile profile = new FakeProfile();
ProfileManager manager = ProfileManagerImpl.getInstance();
manager.registerProfile(profile);
assertTrue("Profile was not correctly registered", manager
@@ -59,7 +57,7 @@
* profile
*/
public void testUnregisterRegisteredProfile() {
- Profile profile = new UserDefinedProfile(new File("someprofile"));
+ Profile profile = new FakeProfile();
ProfileManager manager = ProfileManagerImpl.getInstance();
if (!manager.getRegisteredProfiles().contains(profile)) {
@@ -75,7 +73,7 @@
* profile being removed. In this case it should not raise any exception.
*/
public void testUnregisterUnknownProfile() {
- Profile profile = new UserDefinedProfile(new File("someprofile"));
+ Profile profile = new FakeProfile();
ProfileManager manager = ProfileManagerImpl.getInstance();
if (!manager.getRegisteredProfiles().contains(profile)) {
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.