Author: euluis
Date: 2008-03-05 17:38:01-0800
New Revision: 14181
Modified:
trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java
Log:
issue 4946: now the saving of the model in the test is correct since only the project model is saved in the XMI
Modified: trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java?view=diff&rev=14181&p1=trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java&p2=trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java&r1=14180&r2=14181
==============================================================================
--- trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java (original)
+++ trunk/src/app/tests/org/argouml/kernel/TestProjectWithProfiles.java 2008-03-05 17:38:01-0800
@@ -223,6 +223,10 @@
File userDefinedProfileFile = new File(testCaseDir,
"testProjectWithUserDefinedProfilePersistency.xmi");
mother.saveProfileModel(profileModel, userDefinedProfileFile);
+ // it is required to delete the profile model and load it as a pure
+ // profile, else it will be saved by XmiWriter along with our project
+ // model
+ Model.getUmlFactory().delete(profileModel);
// add it to the project configuration
Profile userDefinedProfile =
new UserDefinedProfile(userDefinedProfileFile);
@@ -257,15 +261,12 @@
project.postLoad();
// assert that the model element that depends on the profile is
// consistent
- // FIXME: the next statement fails because the XMI is saved with the
- // profile model and with the project model!!! Being the project
- // model the second, it won't be part of the project...
fooClass = project.findType("Foo", false);
-// assertNotNull(fooClass);
-// Collection fooStereotypes = getFacade().getStereotypes(fooClass);
-// assertEquals(1, fooStereotypes.size());
-// assertEquals(ProfileMother.STEREOTYPE_NAME_ST,
-// getFacade().getNamespace(fooStereotypes.iterator().next()));
+ assertNotNull(fooClass);
+ Collection fooStereotypes = getFacade().getStereotypes(fooClass);
+ assertEquals(1, fooStereotypes.size());
+ assertEquals(ProfileMother.STEREOTYPE_NAME_ST,
+ getFacade().getName(fooStereotypes.iterator().next()));
}
/**
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.