diff options
author | Asma Smaoui | 2016-03-03 14:55:45 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-03-09 22:07:28 +0000 |
commit | a96ade184f41127dcf6b4ea2345b0b9a4eddbf8a (patch) | |
tree | b250256366c7853fbb574ef76b678a95edd8553c /tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse | |
parent | 33541dfb4f82fd80d105ff7c81cf0ee917b9b3b5 (diff) | |
download | org.eclipse.papyrus-rt-a96ade184f41127dcf6b4ea2345b0b9a4eddbf8a.tar.gz org.eclipse.papyrus-rt-a96ade184f41127dcf6b4ea2345b0b9a4eddbf8a.tar.xz org.eclipse.papyrus-rt-a96ade184f41127dcf6b4ea2345b0b9a4eddbf8a.zip |
Bug 484638 - [Tooling] Regression in naming of InterfaceRealization and
Usage inside a protocol: do the same for the CallEvent name: do not
explicitly set the name to null, unset it instead
Change-Id: Ib19712f442aad9695af85a6a32fba3f7b6c42bb4
Signed-off-by: Asma Smaoui <asma.smaoui@cea.fr>
Diffstat (limited to 'tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse')
3 files changed, 17 insertions, 4 deletions
diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageINOnProtocolValidation.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageINOnProtocolValidation.java index f759f3cb6..2b14639ca 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageINOnProtocolValidation.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageINOnProtocolValidation.java @@ -23,6 +23,7 @@ import org.eclipse.uml2.uml.Interface; import org.eclipse.uml2.uml.Operation; import org.eclipse.uml2.uml.Package; import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.UMLPackage; import org.junit.Assert; /** @@ -65,8 +66,8 @@ public class CreateProtocolMessageINOnProtocolValidation implements IValidationR } Assert.assertNotNull("No CallEvent was found for the new message set", operationCallEvent); // check its name: it should be null - Assert.assertNull("CallEvent should be left unnamed (See bug 469813).", operationCallEvent.getName()); - + // Assert.assertNull("CallEvent should be left unnamed (See bug 469813).", operationCallEvent.getName()); + Assert.assertFalse("CallEvent name should be left unset (See bug 484638).", operationCallEvent.eIsSet(UMLPackage.eINSTANCE.getNamedElement().getEStructuralFeature ("name"))); } protected Operation getOperation(Element targetContainer, Object[] commandResults) { diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageInOnMessageSetInValidation.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageInOnMessageSetInValidation.java index 5b52ab91d..acd7970eb 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageInOnMessageSetInValidation.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolMessageInOnMessageSetInValidation.java @@ -22,6 +22,7 @@ import org.eclipse.uml2.uml.Interface; import org.eclipse.uml2.uml.Operation; import org.eclipse.uml2.uml.Package; import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.UMLPackage; import org.junit.Assert; /** @@ -60,7 +61,8 @@ public class CreateProtocolMessageInOnMessageSetInValidation implements IValidat } Assert.assertNotNull("No CallEvent was found for the new message set", operationCallEvent); // check its name: it should be null - Assert.assertNull("CallEvent should be left unnamed (See bug 469813).", operationCallEvent.getName()); + // Assert.assertNull("CallEvent should be left unnamed (See bug 469813).", operationCallEvent.getName()); + Assert.assertFalse("CallEvent name should be left unset (See bug 484638).", operationCallEvent.eIsSet(UMLPackage.eINSTANCE.getNamedElement().getEStructuralFeature ("name"))); } diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolOnModelValidation.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolOnModelValidation.java index c4843db22..be6aeffeb 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolOnModelValidation.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateProtocolOnModelValidation.java @@ -11,12 +11,15 @@ *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.tests.creation; +import java.util.List; + import org.eclipse.emf.ecore.EObject; import org.eclipse.papyrusrt.umlrt.core.tests.utils.IValidationRule; import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; import org.eclipse.papyrusrt.umlrt.core.utils.ProtocolContainerUtils; import org.eclipse.uml2.uml.Collaboration; +import org.eclipse.uml2.uml.Dependency; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.Interface; import org.eclipse.uml2.uml.Package; @@ -62,7 +65,14 @@ public class CreateProtocolOnModelValidation implements IValidationRule { Interface messageSetInOut = ProtocolContainerUtils.getMessageSetInOut(protocolContainer); Assert.assertNotNull(messageSetInOut); Assert.assertEquals("Protocol1IO", messageSetInOut.getName()); - + + //check that all protocol container dependencies names are unset + List<Dependency> allDependencies=ProtocolContainerUtils.getDependencies(protocolContainer); + if (allDependencies!=null && !allDependencies.isEmpty()) { + for (Dependency dependency: allDependencies) { + Assert.assertFalse(dependency.eIsSet(UMLPackage.eINSTANCE.getNamedElement().getEStructuralFeature ("name"))); + } + } } /** |