From cb1250bac400b91394144552c0ee603087c33b4c Mon Sep 17 00:00:00 2001 From: Onder GURCAN Date: Mon, 12 Oct 2015 11:14:35 +0200 Subject: Bug 475709 - [Tooling] Manage Protocol containment invariance Change-Id: Ide1aa1f0345c8523561f823cca9c16c43cd2608f Signed-off-by: Onder GURCAN --- .../umlrt/core/tests/creation/CreateElementTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse') diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateElementTest.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateElementTest.java index c30cacc93..1fb33f920 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateElementTest.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateElementTest.java @@ -217,6 +217,21 @@ public class CreateElementTest extends AbstractPapyrusTest { // test not creation of EnumerationLiteral in that package runNotCreationTest(newEnumeration, UMLElementTypes.OPERATION, true); } + + @Test + public void testCreateProtocolInModel() throws Exception { + runCreationTest(rootModel, UMLRTElementTypesEnumerator.PROTOCOL, true); + } + + @Test + public void testNotCreateProtocolInClassifier() throws Exception { + // create a package in the root model + CreateElementCommand command = new CreateElementCommand(new CreateElementRequest(rootModel, UMLElementTypes.CLASS)); + command.execute(null, null); + EObject newClassifier = command.getNewElement(); + // test not creation of EnumerationLiteral in that package + runNotCreationTest(newClassifier, UMLRTElementTypesEnumerator.PROTOCOL, true); + } protected void runNotCreationTest(EObject owner, IHintedType hintedType, boolean canCreate) throws Exception { Assert.assertTrue("Editor should not be dirty before test", !openPapyrusEditor.isDirty()); -- cgit v1.2.3