Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremie.tatibouet2015-07-23 08:40:00 -0400
committerJeremie Tatibouet2016-03-21 04:42:09 -0400
commit58df78458a9b40b75f165400e24da7565efb4e8c (patch)
tree6116ed39ea8b044e4a527c9f3dc6ebbfb231370f
parentbface7f4e16d4f0de9e994f726641fa306ee1a04 (diff)
downloadorg.eclipse.papyrus-58df78458a9b40b75f165400e24da7565efb4e8c.tar.gz
org.eclipse.papyrus-58df78458a9b40b75f165400e24da7565efb4e8c.tar.xz
org.eclipse.papyrus-58df78458a9b40b75f165400e24da7565efb4e8c.zip
Should solve the problem related to auto-save of textual representation
failing on "Action language profile is not applied". The associated bug is https://bugs.eclipse.org/bugs/show_bug.cgi?id=473391. The fixes integrates a bunch of unit tests. Conflicts: extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF releng/main-tests/pom.xml Change-Id: I8065b952fafd85a97fdeb88cd5d37c25b3cfcb04 Signed-off-by: jeremie.tatibouet <jeremie.tatibouet@cea.fr>
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.text/src/org/eclipse/papyrus/uml/alf/text/representation/util/RepresentationParser.java2
-rw-r--r--plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/AlfUtil.java208
-rw-r--r--plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/BackupUtil.java306
-rw-r--r--plugins/uml/alf/org.eclipse.papyrus.uml.alf.ui/src/org/eclipse/papyrus/uml/alf/ui/editor/AlfPopupEditor.java1
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.classpath7
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.project28
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/META-INF/MANIFEST.MF25
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/about.html28
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/build.properties7
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml53
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/Activator.java30
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AlfUtilTests.java162
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AllTests.java11
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/BackupUtilTests.java144
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.di2
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.notation2
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.uml6
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.di2
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.notation2
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.uml75
21 files changed, 867 insertions, 241 deletions
diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.text/src/org/eclipse/papyrus/uml/alf/text/representation/util/RepresentationParser.java b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.text/src/org/eclipse/papyrus/uml/alf/text/representation/util/RepresentationParser.java
index 5aab9dfecd9..b6496533214 100644
--- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.text/src/org/eclipse/papyrus/uml/alf/text/representation/util/RepresentationParser.java
+++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.text/src/org/eclipse/papyrus/uml/alf/text/representation/util/RepresentationParser.java
@@ -64,7 +64,7 @@ public class RepresentationParser {
representation.setSource(comment);
representation.setText(comment.getBody());
if (helperBackup.isBackup(comment)) {
- Stereotype backup = helperBackup.getBackuStereotype(modelElement);
+ Stereotype backup = helperBackup.getBackupStereotype(modelElement);
if (backup != null) {
representation.setEditionState(helperBackup.getBackupState(comment));
}
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/AlfUtil.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/AlfUtil.java
index dcc4e0e9f25..eb3a0a4e5c4 100644
--- a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/AlfUtil.java
+++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/AlfUtil.java
@@ -17,9 +17,9 @@
package org.eclipse.papyrus.uml.alf.libraries.helper;
import java.util.Iterator;
-import java.util.List;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
@@ -42,21 +42,6 @@ public class AlfUtil {
private static AlfUtil singleton;
/**
- * The Standard Profile
- */
- protected Profile standardProfile;
-
- /**
- * The Action Language profile
- */
- protected Profile actionLanguageProfile;
-
- /**
- * The TextualRepresentation stereotype (from the Action Language profile)
- */
- protected Stereotype textualRepresentationStereotype;
-
- /**
* Provide a getter to obtain a reference over the helper;
*
* @return singleton
@@ -106,34 +91,25 @@ public class AlfUtil {
}
/**
- * Load the standard profile in the context of the resource in which root is placed.
+ * Retrieve a reference on the standard profile that is used in the specified context
*
- * @param root
+ * @param context
* - the context
* @return a reference to the standard profile
*/
public Profile getStandardProfile(Model context) {
- if (this.standardProfile == null) {
- this.standardProfile = getProfile(context, AlfUtilConstants.STANDARD_PROFILE_NAME);
- }
- return standardProfile;
+ return this.getAppliedProfile(context, AlfUtilConstants.STANDARD_PROFILE_LOADING_NAME);
}
-
+
/**
- * Load the action language profile in the context of the resource in which root is placed.
+ * Retrieve a reference on the action language profile that is used in the specified context
*
- * @param root
+ * @param context
* - the context
* @return a reference to the action language profile
*/
public Profile getActionLanguageProfile(Model context) {
- if (this.actionLanguageProfile == null) {
- actionLanguageProfile = getProfile(context, AlfUtilConstants.ACTION_LANGUAGE_PROFILE_NAME);
- textualRepresentationStereotype =
- actionLanguageProfile.getOwnedStereotype(
- AlfUtilConstants.TEXTUAL_REPRESENTATION_STEREOTYPE_NAME);
- }
- return actionLanguageProfile;
+ return this.getAppliedProfile(context, AlfUtilConstants.ACTION_LANGUAGE_PROFILE_NAME);
}
/**
@@ -145,16 +121,73 @@ public class AlfUtil {
* - the name of the profile that needs to be loaded
* @return profile - a reference to the loaded profile
*/
- protected Profile getProfile(Model context, String name) {
- Profile profile = null;
- IRegisteredProfile registeredProfile = RegisteredProfile.getRegisteredProfile(name);
- if (registeredProfile != null) {
- Resource modelResource = context.eResource().getResourceSet().getResource(registeredProfile.getUri(), true);
- if (modelResource.getContents().get(0) instanceof Profile) {
- profile = (Profile) modelResource.getContents().get(0);
+ public Profile loadProfile(Model context, String name) {
+ /*1. Retrieve the profile from a resource already loaded in the context of the model*/
+ Profile searchedProfile = null;
+ ResourceSet resourceSet = context.eResource().getResourceSet();
+ if (resourceSet != null) {
+ IRegisteredProfile registeredProfile = RegisteredProfile.getRegisteredProfile(name);
+ if (registeredProfile != null) {
+ Iterator<Resource> resourceIterator = resourceSet.getResources().iterator();
+ Resource searchedResource = null;
+ while (searchedResource == null && resourceIterator.hasNext()) {
+ searchedResource = resourceIterator.next();
+ if (!searchedResource.getURI().equals(registeredProfile.getUri())) {
+ searchedResource = null;
+ }
+ }
+ if (searchedResource != null) {
+ searchedProfile = (Profile) searchedResource.getContents().get(0);
+ }
+ }
+ }
+ /* 2. The profile is not loaded in the resourceset of this model. Load it and return a reference to the profile */
+ if (searchedProfile == null) {
+ IRegisteredProfile registeredProfile = RegisteredProfile.getRegisteredProfile(name);
+ if (registeredProfile != null) {
+ Resource modelResource = context.eResource().getResourceSet().getResource(registeredProfile.getUri(), true);
+ if (modelResource.getContents().get(0) instanceof Profile) {
+ searchedProfile = (Profile) modelResource.getContents().get(0);
+ }
+ }
+ }
+ return searchedProfile;
+ }
+
+ /**
+ * Return true if the profile which name is given as parameter is applied on the model;
+ * false otherwise
+ *
+ * @param context
+ * - the model for which the profile application is checked
+ * @param profileName
+ * - the name of the profile for which we try to detect an application
+ * @return
+ * - true if applied false otherwise
+ */
+ protected boolean isProfileApplied(Model context, final String profileName) {
+ return this.getAppliedProfile(context, profileName) != null;
+ }
+
+ /**
+ * Get a reference on the profile that is used in the specified context
+ *
+ * @param context
+ * - the context
+ * @param profileName
+ * - the name of the profile for which we look for an application
+ * @return a reference on the profile or null
+ */
+ protected Profile getAppliedProfile(Model context, final String profileName){
+ Iterator<Profile> appliedProfilesIterator = context.getAppliedProfiles().iterator();
+ Profile searchedProfile = null;
+ while (searchedProfile == null && appliedProfilesIterator.hasNext()) {
+ searchedProfile = appliedProfilesIterator.next();
+ if (!searchedProfile.getName().equals(profileName)) {
+ searchedProfile = null;
}
}
- return profile;
+ return searchedProfile;
}
/**
@@ -164,17 +197,16 @@ public class AlfUtil {
* - the comment from which the definition can retrived
* @return textualRepresentation - the definition of the stereotype textual representation
*/
- private Stereotype getTextualRepresentationStereotype(Comment comment) {
- if (this.textualRepresentationStereotype == null) {
- // There is a chance to find it if the root model has ActionLanguage profile applied
- // In this case, the stereotype is included in comment.getApplicableStereotypes()
- for (Stereotype stereotype : comment.getApplicableStereotypes()) {
- if (stereotype.getName().equals(AlfUtilConstants.TEXTUAL_REPRESENTATION_STEREOTYPE_NAME)) {
- textualRepresentationStereotype = stereotype;
- }
+ private Stereotype getTextualRepresentationStereotype(Element context) {
+ if(context!=null){
+ Profile actionLanguageProfile = this.getAppliedProfile(context.getModel(),
+ AlfUtilConstants.ACTION_LANGUAGE_PROFILE_NAME);
+ if(actionLanguageProfile!=null){
+ return actionLanguageProfile.getOwnedStereotype(
+ AlfUtilConstants.TEXTUAL_REPRESENTATION_STEREOTYPE_NAME);
}
}
- return textualRepresentationStereotype;
+ return null;
}
@@ -202,8 +234,7 @@ public class AlfUtil {
*/
public boolean isActionLanguageProfileApplied(Element context) {
if (context.getModel() != null) {
- List<Profile> appliedProfiles = context.getModel().getAppliedProfiles();
- return appliedProfiles.contains(getActionLanguageProfile(context.getModel()));
+ return this.isProfileApplied(context.getModel(), AlfUtilConstants.ACTION_LANGUAGE_PROFILE_NAME);
}
return false;
}
@@ -217,12 +248,30 @@ public class AlfUtil {
*/
public boolean isStandardProfileApplied(Element context) {
if (context.getModel() != null) {
- List<Profile> appliedProfiles = context.getModel().getAppliedProfiles();
- return appliedProfiles.contains(getStandardProfile(context.getModel()));
+ return this.isProfileApplied(context.getModel(), AlfUtilConstants.STANDARD_PROFILE_LOADING_NAME);
}
return false;
}
+ /**
+ * Build and execute the command that effectively makes the profile applied on the
+ * specified model.
+ *
+ * @param model
+ * - the model on which the profile will be applied
+ * @param profile
+ * - the profile that will be applied
+ * @return true if appplied false otherwise
+ */
+ protected boolean applyProfile(Model model, Profile profile){
+ if(model==null || profile==null){
+ return false;
+ }
+ AbstractTransactionalCommand command = new ApplyProfileCommand(profile, model);
+ TransactionalEditingDomain domain = command.getEditingDomain();
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
+ return command.getCommandResult().getStatus().isOK();
+ }
/**
* Applies the Action Language Profile over the model owning the context element given as parameter
@@ -234,12 +283,8 @@ public class AlfUtil {
public boolean applyActionLanguageProfile(Element context) {
boolean applied = this.isActionLanguageProfileApplied(context);
if (!applied) {
- AbstractTransactionalCommand command = new ApplyProfileCommand(this.actionLanguageProfile, context.getModel());
- TransactionalEditingDomain domain = command.getEditingDomain();
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- if (command.getCommandResult().getStatus().isOK()) {
- applied = true;
- }
+ applied = this.applyProfile(context.getModel(),
+ this.loadProfile(context.getModel(), AlfUtilConstants.ACTION_LANGUAGE_PROFILE_NAME));
}
return applied;
}
@@ -254,58 +299,43 @@ public class AlfUtil {
public boolean applyStandardProfile(Element context) {
boolean applied = this.isStandardProfileApplied(context);
if (!applied) {
- AbstractTransactionalCommand command = new ApplyProfileCommand(this.standardProfile, context.getModel());
- TransactionalEditingDomain domain = command.getEditingDomain();
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- if (command.getCommandResult().getStatus().isOK()) {
- applied = true;
- }
+ applied = this.applyProfile(context.getModel(),
+ this.loadProfile(context.getModel(), AlfUtilConstants.STANDARD_PROFILE_NAME));
}
return applied;
}
/**
- * Create a new textual representation for the given element. This implies the application of the action
- * profile over the model containing the element if this not already done.
+ * Apply the textual representation stereotype (with property value set) on the given comment.
+ * The application only occurs if the action language profile is applied and the stereotype is
+ * not already applied.
*
- * @param element
- * - the element for which the comment is created
- * @return textualRepresentationComment - the created comment
+ * @param comment
+ * - the comment on which the stereotype is applied
+ * @return true if applied false otherwise
*/
- public Comment createTextualRepresentationComment(Element element) {
- Comment textualRepresentationComment = element.createOwnedComment();
- this.applyActionLanguageProfile(element);
- Stereotype textualRepresentationStereotype =
- this.getTextualRepresentationStereotype(textualRepresentationComment);
- textualRepresentationComment.applyStereotype(textualRepresentationStereotype);
- textualRepresentationComment.setValue(textualRepresentationStereotype,
- AlfUtilConstants.TEXTUALREPRESENTATION_LANGUAGE_ATTR_NAME, "Alf");
- return textualRepresentationComment;
- }
-
public boolean applyTextualRepresentation(Comment comment) {
boolean applied = this.isActionLanguageProfileApplied(comment);
if (!applied) {
applied = this.applyActionLanguageProfile(comment);
}
if (applied) {
- comment.applyStereotype(this.textualRepresentationStereotype);
- comment.setValue(this.textualRepresentationStereotype,
- AlfUtilConstants.TEXTUALREPRESENTATION_LANGUAGE_ATTR_NAME, "Alf");
+ if(!this.isATextualRepresentationComment(comment)){
+ Stereotype textualRepresentation = this.getTextualRepresentationStereotype(comment);
+ comment.applyStereotype(textualRepresentation);
+ comment.setValue(textualRepresentation,
+ AlfUtilConstants.TEXTUALREPRESENTATION_LANGUAGE_ATTR_NAME, "Alf");
+ }
}
return applied;
}
- public void clean() {
- this.actionLanguageProfile = null;
- this.textualRepresentationStereotype = null;
- }
-
/**
* Constants used by AlfUtil
*/
class AlfUtilConstants {
protected static final String STANDARD_PROFILE_NAME = "Standard";
+ protected static final String STANDARD_PROFILE_LOADING_NAME = "StandardProfile";
protected static final String ACTION_LANGUAGE_PROFILE_NAME = "ActionLanguage";
protected static final String TEXTUAL_REPRESENTATION_STEREOTYPE_NAME = "TextualRepresentation";
protected static final String TEXTUALREPRESENTATION_LANGUAGE_ATTR_NAME = "language";
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/BackupUtil.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/BackupUtil.java
index 14385eb9384..0da63b95fb4 100644
--- a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/BackupUtil.java
+++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.libraries/src/org/eclipse/papyrus/uml/alf/libraries/helper/BackupUtil.java
@@ -14,20 +14,17 @@
package org.eclipse.papyrus.uml.alf.libraries.helper;
import java.sql.Timestamp;
-import java.util.HashMap;
import java.util.Iterator;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.uml.alf.libraries.helper.BackupState.EditionStatus;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Enumeration;
import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
/**
* Singleton class providing a set of methods to manipulate the backup profile
@@ -39,34 +36,7 @@ public class BackupUtil {
*/
private static BackupUtil singleton;
- /**
- * A reference on the Backup profile
- */
- protected Profile backupProfile;
-
- /**
- * A reference on the stereotype Backup
- */
- protected Stereotype backupStereotype;
-
- /**
- * A reference to the enumeration BackupState
- */
- protected Enumeration backupStateEnumeration;
-
- /**
- * Mapping between UML Enumeration BackupState and its Java Implementation
- */
- private HashMap<EditionStatus, EnumerationLiteral> stateMapping;
-
- /**
- * Reverse mapping
- */
- private HashMap<EnumerationLiteral, EditionStatus> inverseStateMapping;
-
private BackupUtil() {
- this.stateMapping = new HashMap<EditionStatus, EnumerationLiteral>();
- this.inverseStateMapping = new HashMap<EnumerationLiteral, EditionStatus>();
}
/**
@@ -82,35 +52,72 @@ public class BackupUtil {
}
/**
- * Load the backup profile in the context of the resource owning the element given as a parameter.
+ * Get the reference to the backup profile that is applied on the given model
*
* @param context
+ * - the model on which the profile is applied
+ * @return a reference to the applied profile
+ */
+ public Profile getBackupProfile(Model context) {
+ return AlfUtil.getInstance().getAppliedProfile(context, BackupUtilConstants.BACKUP_PROFILE_NAME);
+ }
+
+ /**
+ * Retrieve the Backup stereotype definition
+ *
+ * @param element
* - the context element
- * @return backupProfile - a reference to the loaded profile
+ * @return backupStereotype - the definition of the stereotype
*/
- public Profile getBackupProfile(Element context) {
- if (this.backupProfile == null) {
- this.backupProfile = AlfUtil.getInstance().getProfile(context.getModel(), BackupUtilConstants.BACKUP_PROFILE_NAME);
- this.backupStereotype = this.backupProfile.getOwnedStereotype(BackupUtilConstants.BACKUP_STEREOTYPE_NAME);
- this.backupStateEnumeration = (Enumeration) this.backupProfile.getOwnedType(BackupUtilConstants.BACKUP_BACKUP_STATE_ENUMERATION_NAME);
- this.initInternalConverter();
+ public Stereotype getBackupStereotype(Element context) {
+ if (context != null) {
+ Profile backupProfile = this.getBackupProfile(context.getModel());
+ return backupProfile.getOwnedStereotype(BackupUtilConstants.BACKUP_STEREOTYPE_NAME);
}
- return this.backupProfile;
+ return null;
}
- private void initInternalConverter() {
- for (EnumerationLiteral literal : this.backupStateEnumeration.getOwnedLiterals()) {
- if (literal.getLabel().equals("NONE")) {
- stateMapping.put(EditionStatus.NONE, literal);
- inverseStateMapping.put(literal, EditionStatus.NONE);
- } else if (literal.getLabel().equals("SAVED")) {
- stateMapping.put(EditionStatus.SAVED, literal);
- inverseStateMapping.put(literal, EditionStatus.SAVED);
- } else {
- stateMapping.put(EditionStatus.MERGED, literal);
- inverseStateMapping.put(literal, EditionStatus.MERGED);
+ /**
+ * Retrieve the definition of the Enumerated type BackupState
+ *
+ * @param context
+ * - a model that has the backup profile applied
+ * @return a reference to the ennumeration specifying the backup state
+ */
+ public Enumeration getBackupStateDefinition(Element context) {
+ if (context != null) {
+ Profile backupProfile = this.getBackupProfile(context.getModel());
+ if (backupProfile != null) {
+ Type backupStateDefinition = backupProfile.getOwnedType(BackupUtilConstants.BACKUP_BACKUP_STATE_ENUMERATION_NAME);
+ if (backupStateDefinition != null &&
+ backupStateDefinition instanceof Enumeration) {
+ return (Enumeration) backupStateDefinition;
+ }
}
}
+ return null;
+ }
+
+ /**
+ * if the given element has a comment that has the backup
+ * stereotype applied then return that comment
+ *
+ * @param element
+ * - the element from which the search is initiated
+ * @return a comment or null
+ */
+ public Comment getBackupComment(Element element) {
+ Comment backupComment = null;
+ if (element != null) {
+ Iterator<Comment> iteratorComments = element.getOwnedComments().iterator();
+ while (iteratorComments.hasNext() && backupComment == null) {
+ Comment current = iteratorComments.next();
+ if (current.getAppliedStereotypes().contains(this.getBackupStereotype(element))) {
+ backupComment = current;
+ }
+ }
+ }
+ return backupComment;
}
/**
@@ -120,39 +127,92 @@ public class BackupUtil {
* - the assessed element
* @return true if the stereotype is applied
*/
- public boolean isBackup(Element element) {
- boolean found = false;
- Iterator<Comment> iteratorComments = element.getOwnedComments().iterator();
- while (iteratorComments.hasNext() && !found) {
- Comment current = iteratorComments.next();
- if (current.getAppliedStereotypes().contains(this.backupStereotype)) {
- found = true;
+ public boolean hasBackupComment(Element element) {
+ return this.getBackupComment(element) != null;
+ }
+
+ /**
+ * Determines if the given comment has the backup stereotype applied
+ *
+ * @param comment
+ * - the comment which is assessed
+ * @return true if the stereotype is applie false otherwise
+ */
+ public boolean isBackup(Comment comment){
+ if(comment!=null){
+ Stereotype backupStereotype = this.getBackupStereotype(comment);
+ if(backupStereotype!=null){
+ return comment.getAppliedStereotypes().contains(backupStereotype);
}
}
- return found;
+ return false;
}
-
- public boolean isBackup(Comment comment) {
- return comment.getAppliedStereotypes().contains(this.backupStereotype);
+
+ /**
+ * Returns the BackupState applied to this comment
+ *
+ * @param comment
+ * - the comment containing the backup information
+ * @return state - the backup information
+ */
+ public BackupState getBackupState(Comment comment) {
+ BackupState state = null;
+ if (comment != null) {
+ /* 1. Extract time information */
+ String timestamp = (String) comment.getValue(this.getBackupStereotype(comment),
+ BackupUtilConstants.BACKUP_TIMESTAMP_ATTR_NAME);
+ /* 2. Extract textual representation state information */
+ EnumerationLiteral literal = (EnumerationLiteral) comment.getValue(this.getBackupStereotype(comment),
+ BackupUtilConstants.BACKUP_STATE_ATTR_NAME);
+ /* 3. Build state */
+ state = new BackupState();
+ try {
+ state.timestamp = Timestamp.valueOf(timestamp);
+ } catch (Exception e) {
+ }
+ state.status = this.map(literal);
+ }
+ return state;
}
-
+
/**
- * Retrieve the Backup stereotype definition
*
- * @param element
- * - the context element
- * @return backupStereotype - the definition of the stereotype
+ * @param literal
+ * @return
*/
- public Stereotype getBackuStereotype(Element element) {
- if (this.backupStereotype != null) {
- return this.backupStereotype;
+ private EditionStatus map(EnumerationLiteral literal){
+ EditionStatus status = null;
+ if(literal.getLabel().equals("NONE")){
+ status = EditionStatus.NONE;
+ }else if(literal.getLabel().equals("SAVED")){
+ status = EditionStatus.SAVED;
+ }else if(literal.getLabel().equals("MERGED")){
+ status = EditionStatus.MERGED;
}
- else if (this.isBackupProfileApplied(element) && !element.getOwnedComments().isEmpty()) {
- this.backupStereotype = element.getOwnedComments().get(0).getApplicableStereotype(BackupUtilConstants.BACKUP_STEREOTYPE_NAME);
- return this.backupStereotype;
- } else {
- return null;
+ return status;
+ }
+
+ /**
+ *
+ * @param editionStatus
+ * @param context
+ * @return
+ */
+ private EnumerationLiteral map(EditionStatus editionStatus, Element context){
+ EnumerationLiteral status = null;
+ if(context!=null){
+ Enumeration backupState = this.getBackupStateDefinition(context);
+ if(backupState!=null){
+ if(editionStatus.equals(EditionStatus.NONE)){
+ status = backupState.getOwnedLiteral("NONE");
+ }else if(editionStatus.equals(EditionStatus.SAVED)){
+ status = backupState.getOwnedLiteral("SAVED");
+ }else if(editionStatus.equals(EditionStatus.MERGED)){
+ status = backupState.getOwnedLiteral("MERGED");
+ }
+ }
}
+ return status;
}
/**
@@ -168,53 +228,25 @@ public class BackupUtil {
* @return true if the applications was realized
*/
public boolean applyBackup(Comment comment, final BackupState state) {
- boolean applied = false;
- boolean profileApplied = true;
- if (!this.isBackupProfileApplied(comment)) {
- if (this.backupProfile == null) {
- this.getBackupProfile(comment);
- }
- profileApplied = PackageUtil.applyProfile((org.eclipse.uml2.uml.Package)
- comment.getModel(), this.backupProfile, true);
+ boolean applied = this.isBackupProfileApplied(comment);
+ if (!applied) {
+ applied = this.applyBackupProfile(comment);
}
- if (profileApplied) {
+ if (applied) {
+ Stereotype backupStereotype = this.getBackupStereotype(comment);
/* 1. Apply the stereotype */
- if (!this.isBackup(comment)) {
- comment.applyStereotype(this.backupStereotype);
+ if(!this.isBackup(comment)){
+ comment.applyStereotype(backupStereotype);
}
/* 2. Set time stamp attribute */
- comment.setValue(this.backupStereotype, BackupUtilConstants.BACKUP_TIMESTAMP_ATTR_NAME, state.timestamp.toString());
+ comment.setValue(backupStereotype, BackupUtilConstants.BACKUP_TIMESTAMP_ATTR_NAME, state.timestamp.toString());
/* 3. Set state attribute */
- comment.setValue(this.backupStereotype, BackupUtilConstants.BACKUP_STATE_ATTR_NAME, this.stateMapping.get(state.status));
+ comment.setValue(backupStereotype, BackupUtilConstants.BACKUP_STATE_ATTR_NAME, this.map(state.status, comment));
}
return applied;
}
- /**
- * Returns the BackupState applied to this comment
- *
- * @param comment
- * - the comment containing the backup information
- * @return state - the backup information
- */
- public BackupState getBackupState(Comment comment) {
- BackupState state = null;
- if (this.isBackup(comment)) {
- state = new BackupState();
- String timestamp = (String) comment.getValue(this.backupStereotype, BackupUtilConstants.BACKUP_TIMESTAMP_ATTR_NAME);
- if (timestamp != null && !timestamp.isEmpty()) {
- try {
- state.timestamp = Timestamp.valueOf(timestamp);
- } catch (Exception e) {
- }
- }
- EnumerationLiteral literal = (EnumerationLiteral) comment.getValue(this.backupStereotype, BackupUtilConstants.BACKUP_STATE_ATTR_NAME);
- if (state != null) {
- state.status = this.inverseStateMapping.get(literal);
- }
- }
- return state;
- }
+
/**
* Applies the backup profile over the model owning the context element provided as a parameter
@@ -225,52 +257,26 @@ public class BackupUtil {
*/
public boolean applyBackupProfile(Element context) {
boolean applied = this.isBackupProfileApplied(context);
- if (!applied) {
- this.backupProfile = this.getBackupProfile(context);
- if (this.backupProfile != null) {
- AbstractTransactionalCommand command = new ApplyProfileCommand(this.backupProfile, context.getModel());
- TransactionalEditingDomain domain = command.getEditingDomain();
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- if (command.getCommandResult().getStatus().isOK()) {
- applied = true;
- }
- }
+ if(!applied){
+ applied = AlfUtil.getInstance().applyProfile(context.getModel(),
+ AlfUtil.getInstance().loadProfile(context.getModel(),
+ BackupUtilConstants.BACKUP_PROFILE_LOADING_NAME));
}
return applied;
}
-
+
/**
- * Returns whether the backup profile is applied over the context model
*
* @param context
- * - the UML element used as context
- * @return true if the profile is applied
+ * @return
*/
- public boolean isBackupProfileApplied(Element context) {
- return context.getModel().getAllAppliedProfiles().contains(this.backupProfile);
- }
-
- public Comment getBackupComment(Element element) {
- Comment comment = null;
- Iterator<Comment> iteratorComments = element.getOwnedComments().iterator();
- while (iteratorComments.hasNext() && comment == null) {
- Comment current = iteratorComments.next();
- if (current.getAppliedStereotypes().contains(this.backupStereotype)) {
- comment = current;
- }
- }
- return comment;
- }
-
- public Enumeration getBackupState(Element context) {
- if (this.backupStateEnumeration == null) {
- this.getBackupProfile(context);
- }
- return this.backupStateEnumeration;
+ public boolean isBackupProfileApplied(Element context){
+ return this.getBackupProfile(context.getModel()) != null;
}
public class BackupUtilConstants {
- public static final String BACKUP_PROFILE_NAME = "TextualRepresentationBackup";
+ public static final String BACKUP_PROFILE_NAME = "BackupProfile";
+ public static final String BACKUP_PROFILE_LOADING_NAME = "TextualRepresentationBackup";
public static final String BACKUP_STEREOTYPE_NAME = "Backup";
public static final String BACKUP_BACKUP_STATE_ENUMERATION_NAME = "BackupState";
public static final String BACKUP_TIMESTAMP_ATTR_NAME = "timestamp";
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.ui/src/org/eclipse/papyrus/uml/alf/ui/editor/AlfPopupEditor.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.ui/src/org/eclipse/papyrus/uml/alf/ui/editor/AlfPopupEditor.java
index 8ee49a46150..20eac7bf53e 100644
--- a/plugins/uml/alf/org.eclipse.papyrus.uml.alf.ui/src/org/eclipse/papyrus/uml/alf/ui/editor/AlfPopupEditor.java
+++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf.ui/src/org/eclipse/papyrus/uml/alf/ui/editor/AlfPopupEditor.java
@@ -68,7 +68,6 @@ public class AlfPopupEditor {
}
public void openEditor() {
- AlfUtil.getInstance().clean();
// Creation of the parent shell
this.alfEditorParentComposite = new Shell(SWT.RESIZE | SWT.DIALOG_TRIM | SWT.ON_TOP);
String title = "";
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.classpath b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.classpath
new file mode 100644
index 00000000000..b1dabee3829
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.project b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.project
new file mode 100644
index 00000000000..f0f5cd74caf
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.alf.backend.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..11f6e462df7
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..0c9030952f7
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ALF Backend Tests
+Bundle-SymbolicName: org.eclipse.papyrus.uml.alf.backend.tests
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.alf.backend.tests.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit,
+ org.eclipse.papyrus.junit.utils;bundle-version="1.1.0",
+ org.eclipse.emf.ecore;bundle-version="2.11.0",
+ org.eclipse.uml2.uml;bundle-version="5.1.0",
+ org.eclipse.emf.edit;bundle-version="2.11.0",
+ org.eclipse.core.commands;bundle-version="3.7.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.emf.transaction;bundle-version="1.9.0",
+ org.eclipse.papyrus.junit.framework,
+ org.eclipse.papyrus.uml.alf.libraries,
+ org.eclipse.papyrus.infra.gmfdiag.commands,
+ org.eclipse.gmf.common;bundle-version="1.3.0",
+ org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.uml.extensionpoints
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/about.html b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/build.properties b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/build.properties
new file mode 100644
index 00000000000..783f3733b01
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ test-models/,\
+ about.html
+src.includes = about.html
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml
new file mode 100644
index 00000000000..935ec060486
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.tests.releng</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../../../releng/main-tests</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.alf.backend.tests</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <fileset>
+ <directory>xtend-gen</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ </excludes>
+ </fileset>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>xtend-gen</outputDirectory>
+ <testOutputDirectory>${project.build.directory}/xtend-gen/test</testOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/Activator.java b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/Activator.java
new file mode 100644
index 00000000000..411fb99eaf8
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/Activator.java
@@ -0,0 +1,30 @@
+package org.eclipse.papyrus.uml.alf.backend.tests;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AlfUtilTests.java b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AlfUtilTests.java
new file mode 100644
index 00000000000..89648467198
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AlfUtilTests.java
@@ -0,0 +1,162 @@
+package org.eclipse.papyrus.uml.alf.backend.tests;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.alf.libraries.helper.AlfUtil;
+import org.eclipse.papyrus.uml.extensionpoints.profile.IRegisteredProfile;
+import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Profile;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class AlfUtilTests extends AbstractPapyrusTest {
+
+ @Rule
+ public final ModelSetFixture modelSetFixture = new ModelSetFixture();
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testActionLanguageNotApplied() {
+ Assert.assertFalse(AlfUtil.getInstance().isActionLanguageProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testStandardProfileNotapplied() {
+ Assert.assertFalse(AlfUtil.getInstance().isStandardProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testActionLanguageProfileApplication() {
+ AlfUtil.getInstance().applyActionLanguageProfile(
+ this.modelSetFixture.getModel());
+ List<Profile> appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ Assert.assertTrue(appliedProfiles.get(0).getName().equals("ActionLanguage"));
+ AlfUtil.getInstance().applyActionLanguageProfile(
+ this.modelSetFixture.getModel());
+ appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ Assert.assertTrue("The action language profile should detected as applied", AlfUtil.getInstance().isActionLanguageProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testStandardProfileApplication() {
+ AlfUtil.getInstance().applyStandardProfile(
+ this.modelSetFixture.getModel());
+ List<Profile> appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ AlfUtil.getInstance().applyStandardProfile(
+ this.modelSetFixture.getModel());
+ appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ Assert.assertTrue("The standard profile should detected as applied", AlfUtil.getInstance().
+ isStandardProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testProfileLoading() {
+ Iterator<Resource> resourcesIterator = this.modelSetFixture.getResourceSet().getResources().iterator();
+ IRegisteredProfile registeredProfile = RegisteredProfile.getRegisteredProfile("ActionLanguage");
+ if (registeredProfile == null) {
+ Assert.fail("The Action language profile should a registered profile of Papyrus");
+ }
+ while (resourcesIterator.hasNext()) {
+ if (resourcesIterator.next().getURI().equals(registeredProfile.getUri())) {
+ Assert.fail("The Action language profile should not already be loaded");
+ }
+ }
+ /* A. The profile must be loaded in a Resource located in the resource set of the current model */
+ Profile actionLanguageProfileRef1 = AlfUtil.getInstance().loadProfile((Model) this.modelSetFixture.getModel(), "ActionLanguage");
+ resourcesIterator = this.modelSetFixture.getResourceSet().getResources().iterator();
+ Resource foundResource = null;
+ while (foundResource == null && resourcesIterator.hasNext()) {
+ Resource current = resourcesIterator.next();
+ if (current.getURI().equals(registeredProfile.getUri())) {
+ foundResource = current;
+ }
+ }
+ Assert.assertNotNull("The action language profile was not loaded", foundResource);
+ /* B. If we retry to load the profile the number of loaded resource does not vary */
+ int sizeBeforeLoading = this.modelSetFixture.getResourceSet().getResources().size();
+ Profile actionLanguageProfileRef2 = AlfUtil.getInstance().loadProfile((Model) this.modelSetFixture.getModel(), "ActionLanguage");
+ int sizeAfterLoading = this.modelSetFixture.getResourceSet().getResources().size();
+ Assert.assertEquals("The number of loaded resources must be the same", sizeBeforeLoading,
+ sizeAfterLoading);
+ Assert.assertTrue("Both references should point on the same profile instance",
+ actionLanguageProfileRef1==actionLanguageProfileRef2);
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testDetectTextualRepresentationStereotype() {
+ Class testClass1 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass1");
+ Class testClass2 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass2");
+ final Class testClass3 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass3");
+ Assert.assertNotNull(testClass1);
+ Assert.assertNotNull(testClass2);
+ Assert.assertNotNull(testClass3);
+ /* A. TestClass1 must have a textual representation comment */
+ Assert.assertNotNull(AlfUtil.getInstance().getTextualRepresentationComment(testClass1));
+ /* B. TestClass2 must have a textual representation comment */
+ Assert.assertNotNull(AlfUtil.getInstance().getTextualRepresentationComment(testClass2));
+ /* C. TestClass3 must not have a textual representation comment */
+ Assert.assertNull(AlfUtil.getInstance().getTextualRepresentationComment(testClass3));
+ /* D. TestClass3 must now have a textual representation comment */
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(this.modelSetFixture.getModel());
+ GMFtoEMFCommandWrapper command = new GMFtoEMFCommandWrapper(
+ new AbstractTransactionalCommand(domain, "", Collections.EMPTY_LIST) {
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ AlfUtil.getInstance().applyTextualRepresentation(testClass3.getOwnedComments().get(0));
+ return CommandResult.newOKCommandResult();
+ }
+ });
+ domain.getCommandStack().execute(command);
+ Assert.assertNotNull(AlfUtil.getInstance().getTextualRepresentationComment(testClass3));
+ /*E. Another attempt to apply the textual representation stereotype should not result in an error*/
+ try{
+ domain.getCommandStack().execute(command);
+ }catch(Exception e){
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testRetrieveActionLanguageProfileReference(){
+ Assert.assertNotNull("It should be possible to obtain a reference on the action language profile",
+ AlfUtil.getInstance().getActionLanguageProfile((Model)this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testRetrieveStandardProfileReference(){
+ Assert.assertNotNull("It should be possible to obtain a reference on the standard profile",
+ AlfUtil.getInstance().getStandardProfile((Model)this.modelSetFixture.getModel()));
+ }
+}
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AllTests.java b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AllTests.java
new file mode 100644
index 00000000000..b4e4e90f078
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/AllTests.java
@@ -0,0 +1,11 @@
+package org.eclipse.papyrus.uml.alf.backend.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({AlfUtilTests.class, BackupUtilTests.class})
+public class AllTests {
+
+}
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/BackupUtilTests.java b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/BackupUtilTests.java
new file mode 100644
index 00000000000..0e05eacdb9a
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/src/org/eclipse/papyrus/uml/alf/backend/tests/BackupUtilTests.java
@@ -0,0 +1,144 @@
+package org.eclipse.papyrus.uml.alf.backend.tests;
+
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.alf.libraries.helper.BackupState;
+import org.eclipse.papyrus.uml.alf.libraries.helper.BackupState.EditionStatus;
+import org.eclipse.papyrus.uml.alf.libraries.helper.BackupUtil;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.Stereotype;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class BackupUtilTests {
+
+ @Rule
+ public final ModelSetFixture modelSetFixture = new ModelSetFixture();
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testBackupProfileNotApplied(){
+ Assert.assertFalse(BackupUtil.getInstance().
+ isBackupProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testBackupProfileIsApplied(){
+ Assert.assertTrue("The backup profile should be applied", BackupUtil.getInstance().
+ isBackupProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testRetrieveBackupProfileReference(){
+ Assert.assertNotNull("It should be possible to obtain a reference on the backup profile",
+ BackupUtil.getInstance().getBackupProfile((Model)this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/empty-model.di" })
+ public void testBackupProfileApplication(){
+ BackupUtil.getInstance().applyBackupProfile(
+ this.modelSetFixture.getModel());
+ List<Profile> appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ BackupUtil.getInstance().applyBackupProfile(
+ this.modelSetFixture.getModel());
+ appliedProfiles = this.modelSetFixture.getModel().getAppliedProfiles();
+ Assert.assertEquals("Unexpected number of applied profiles",
+ 1, appliedProfiles.size());
+ Assert.assertTrue("The backup profile should be detected as being applied",
+ BackupUtil.getInstance().isBackupProfileApplied(this.modelSetFixture.getModel()));
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testRetrievalOfBackupStereotype(){
+ Class testClass1 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass1");
+ Stereotype backupStereotype = BackupUtil.getInstance().getBackupStereotype(testClass1);
+ Assert.assertNotNull("In this context the Backup stereotype should be accessible", backupStereotype);
+ Assert.assertTrue(BackupUtil.getInstance().getBackupProfile((Model)this.modelSetFixture.getModel())
+ == backupStereotype.getProfile());
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testRetrievalOfBackupStateDefinition(){
+ Class testClass1 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass1");
+ Enumeration backupState = BackupUtil.getInstance().getBackupStateDefinition(testClass1);
+ Assert.assertNotNull("In this context the BackupState type should be accessible", backupState);
+ Assert.assertTrue(BackupUtil.getInstance().getBackupProfile((Model)this.modelSetFixture.getModel())
+ == backupState.getOwner());
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testDetectBackupStereotype(){
+ Class testClass1 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass1");
+ Class testClass2 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass2");
+ final Class testClass3 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass3");
+ Assert.assertNotNull(testClass1);
+ Assert.assertNotNull(testClass2);
+ Assert.assertNotNull(testClass3);
+ /*A. The backup stereotype must be applied on a comment owned by TestClass1*/
+ Assert.assertNotNull(BackupUtil.getInstance().getBackupComment(testClass1));
+ /*B. The backup stereotype must be applied on a comment owned by TestClass2*/
+ Assert.assertNotNull(BackupUtil.getInstance().getBackupComment(testClass2));
+ /*C. The backup stereotype must not be applied on comment owned by TestClass3*/
+ Assert.assertNull(BackupUtil.getInstance().getBackupComment(testClass3));
+ }
+
+ @Test
+ @PluginResource({ "test-models/model-with-alf.di" })
+ public void testBackupStereotypeApplication(){
+ final Class testClass3 = (Class) this.modelSetFixture.getModel().getOwnedType("TestClass3");
+ Assert.assertNotNull(testClass3);
+ /*A.Apply the stereotype and set the properties values*/
+ final Timestamp timestamp = new Timestamp(Calendar.getInstance().getTimeInMillis());
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(this.modelSetFixture.getModel());
+ GMFtoEMFCommandWrapper command = new GMFtoEMFCommandWrapper(
+ new AbstractTransactionalCommand(domain, "", Collections.EMPTY_LIST) {
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ BackupState state = new BackupState();
+ state.timestamp = timestamp;
+ state.status = EditionStatus.MERGED;
+ BackupUtil.getInstance().applyBackup(testClass3.getOwnedComments().get(0), state);
+ return CommandResult.newOKCommandResult();
+ }
+ });
+ domain.getCommandStack().execute(command);
+ /*B. Ensure it was correctly applied (i.e., check properties values)*/
+ Comment stereotypedComment = BackupUtil.getInstance().getBackupComment(testClass3);
+ Assert.assertNotNull(stereotypedComment);
+ BackupState state = BackupUtil.getInstance().getBackupState(stereotypedComment);
+ Assert.assertEquals("Timestamps should be equivalent", timestamp, state.timestamp);
+ Assert.assertEquals("Edition status should be equivalent", EditionStatus.MERGED, state.status);
+ /*C. Another attempt to apply the stereotype should not result in an error*/
+ try{
+ domain.getCommandStack().execute(command);
+ }catch(Exception e){
+ Assert.fail(e.getMessage());
+ }
+ }
+}
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.di b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.di
new file mode 100644
index 00000000000..8634d4c00e0
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.notation b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.notation
new file mode 100644
index 00000000000..8634d4c00e0
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.notation
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.uml b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.uml
new file mode 100644
index 00000000000..6d376f3b610
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/empty-model.uml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_HorksDBkEeWIG7E3TDTNig" name="RootElement">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_IJ6CcDBkEeWIG7E3TDTNig">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.di b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.di
new file mode 100644
index 00000000000..8634d4c00e0
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.notation b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.notation
new file mode 100644
index 00000000000..8634d4c00e0
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.notation
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.uml b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.uml
new file mode 100644
index 00000000000..5d62b70cfc2
--- /dev/null
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/test-models/model-with-alf.uml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ActionLanguage="http://www.omg.org/spec/ALF/20120827/ActionLanguage-Profile" xmlns:BackupProfile="http:///schemas/BackupProfile/_J7IFgKInEeS_KNX0nfvIVQ/1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http://www.omg.org/spec/ALF/20120827/ActionLanguage-Profile pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#_Kv8EIKFXEeS_KNX0nfvIVQ http:///schemas/BackupProfile/_J7IFgKInEeS_KNX0nfvIVQ/1 pathmap://PAPYRUS_BACKUP_PROFILE/backup-profile.profile.uml#_J7IFgaInEeS_KNX0nfvIVQ">
+ <uml:Model xmi:id="_s4hsMDB0EeWIG7E3TDTNig" name="RootElement">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_s_FAIDB0EeWIG7E3TDTNig">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_z7R9QDB0EeWIG7E3TDTNig" name="TestClass1">
+ <ownedComment xmi:type="uml:Comment" xmi:id="_9LJmIDB0EeWIG7E3TDTNig">
+ <body>namespace RootElement;&#xD;
+&#xD;
+class TestClass{&#xD;
+&#xD;
+}</body>
+ </ownedComment>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_TIpYMDB1EeWIG7E3TDTNig" name="TestClass2">
+ <ownedComment xmi:type="uml:Comment" xmi:id="_VSvRMDB1EeWIG7E3TDTNig">
+ <body>This is a test class&#xD;
+</body>
+ </ownedComment>
+ <ownedComment xmi:type="uml:Comment" xmi:id="_XFaIsDB1EeWIG7E3TDTNig">
+ <body>namespace RootElement;&#xD;
+&#xD;
+class TestClass2{&#xD;
+&#xD;
+}</body>
+ </ownedComment>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pybBcDB1EeWIG7E3TDTNig" name="TestClass3">
+ <ownedComment xmi:type="uml:Comment" xmi:id="_Kx-rYDB5EeWIG7E3TDTNig">
+ <body>namespace RootElement;&#xD;
+&#xD;
+class TestClass3{&#xD;
+&#xD;
+}</body>
+ </ownedComment>
+ </packagedElement>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_4vMYMDB0EeWIG7E3TDTNig">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4vQpoDB0EeWIG7E3TDTNig" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vQpoTB0EeWIG7E3TDTNig" key="Version" value="0.1.1"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vQpojB0EeWIG7E3TDTNig" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vQpozB0EeWIG7E3TDTNig" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vQppDB0EeWIG7E3TDTNig" key="Date" value="2015-01-21"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vQppTB0EeWIG7E3TDTNig" key="Author" value=""/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4vNmUDB0EeWIG7E3TDTNig" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#_Kv8EIKFXEeS_KNX0nfvIVQ"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="pathmap://PAPYRUS_ACTIONLANGUAGE_PROFILE/ActionLanguage-Profile.profile.uml#ActionLanguage"/>
+ </profileApplication>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_4vRQsDB0EeWIG7E3TDTNig">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4vR3wDB0EeWIG7E3TDTNig" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vR3wTB0EeWIG7E3TDTNig" key="Version" value="0.0.2"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vR3wjB0EeWIG7E3TDTNig" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vR3wzB0EeWIG7E3TDTNig" key="Copyright" value="CEA LIST"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vR3xDB0EeWIG7E3TDTNig" key="Date" value="2015-01-22"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_4vR3xTB0EeWIG7E3TDTNig" key="Author" value=""/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_4vRQsTB0EeWIG7E3TDTNig" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://PAPYRUS_BACKUP_PROFILE/backup-profile.profile.uml#_J7IFgaInEeS_KNX0nfvIVQ"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="pathmap://PAPYRUS_BACKUP_PROFILE/backup-profile.profile.uml#_74TbUKFzEeS_KNX0nfvIVQ"/>
+ </profileApplication>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_7fcSQDB0EeWIG7E3TDTNig">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7fc5UDB0EeWIG7E3TDTNig" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard#/"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+ </profileApplication>
+ </uml:Model>
+ <BackupProfile:Backup xmi:id="_-QwjUDB0EeWIG7E3TDTNig" timestamp="2015-07-21 16:17:47.476" base_Comment="_9LJmIDB0EeWIG7E3TDTNig"/>
+ <ActionLanguage:TextualRepresentation xmi:id="_-RHIoDB0EeWIG7E3TDTNig" base_Comment="_9LJmIDB0EeWIG7E3TDTNig" language="Alf"/>
+ <BackupProfile:Backup xmi:id="_YNaSkDB1EeWIG7E3TDTNig" timestamp="2015-07-21 16:17:47.476" base_Comment="_XFaIsDB1EeWIG7E3TDTNig"/>
+ <ActionLanguage:TextualRepresentation xmi:id="_YNhnUDB1EeWIG7E3TDTNig" base_Comment="_XFaIsDB1EeWIG7E3TDTNig" language="Alf"/>
+</xmi:XMI>

Back to the top