diff options
author | Remi Schnekenburger | 2015-11-20 15:39:14 +0000 |
---|---|---|
committer | Remi Schnekenburger | 2015-11-20 15:39:14 +0000 |
commit | e79aa47d1609e199e7a0d9154f7afd9433da8c1b (patch) | |
tree | af4bff506d83e2df51b9ab42dc64407bf5052a57 /tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt | |
parent | 75f0e627c88124fd304da5bc4c9e5e0e67fe14d8 (diff) | |
download | org.eclipse.papyrus-rt-e79aa47d1609e199e7a0d9154f7afd9433da8c1b.tar.gz org.eclipse.papyrus-rt-e79aa47d1609e199e7a0d9154f7afd9433da8c1b.tar.xz org.eclipse.papyrus-rt-e79aa47d1609e199e7a0d9154f7afd9433da8c1b.zip |
481607: [Tooling] RT State Machine creation should be supported in model
explorer
https://bugs.eclipse.org/bugs/show_bug.cgi?id=481607
- Change diagram name display in editor and model explorer. If specific
diagram name has been set, it will display the specific name
- move label provider for state machine in common, to avoid losing
customized label for capsule diagram (issue in Papyrus facet)
- Removing the possibility to create a RTStateMachine on passive classes
Change-Id: Idaca10573447012550ea3b09377fb8b86244fd22
Signed-off-by: Remi Schnekenburger <remi.schnekenburger@cea.fr>
Diffstat (limited to 'tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt')
2 files changed, 15 insertions, 3 deletions
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 1f2443e7b..f366860ad 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 @@ -78,6 +78,16 @@ public class CreateElementTest extends AbstractPapyrusRTCoreTest { } @Test + public void testCreateStateMachineInPassiveClass() throws Exception { + CreateElementCommand command = new CreateElementCommand(new CreateElementRequest(rootModel, UMLElementTypes.CLASS)); + command.execute(null, null); + EObject newClass = command.getNewElement(); + // test not creation of EnumerationLiteral in that package + runNotCreationTest(newClass, UMLRTElementTypesEnumerator.RT_STATE_MACHINE, true); + } + + + @Test public void testNotCreateAttributeInEnumeration() throws Exception { // create a package in the root model CreateElementCommand command = new CreateElementCommand(new CreateElementRequest(rootModel, UMLElementTypes.ENUMERATION)); diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateRTStateMachineOnCapsuleValidation.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateRTStateMachineOnCapsuleValidation.java index 701120dad..d5bedb643 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateRTStateMachineOnCapsuleValidation.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateRTStateMachineOnCapsuleValidation.java @@ -45,11 +45,13 @@ public class CreateRTStateMachineOnCapsuleValidation implements IValidationRule // 1.1 check name // 1.2 check stereotype application // 1.3 check the constraint on isrentrant - // 1.4 check the behavior classifier containement feature from Capsule + // 1.4 check the state machine is not passive (RTStateMachine.isPassive = false) + // 1.5 check the behavior classifier containement feature from Capsule StateMachine newStateMachine = getStateMachine(targetContainer, commandResults); - Assert.assertEquals("State machine name is wrong", "StateMachine1", newStateMachine.getName()); + Assert.assertEquals("State machine name is wrong", "StateMachine", newStateMachine.getName()); Assert.assertNotNull("State machine should have RTStateMachine stereotype applied", UMLUtil.getStereotypeApplication(newStateMachine, RTStateMachine.class)); Assert.assertFalse("State machine should not be reentrant", newStateMachine.isReentrant()); + Assert.assertFalse("State machine should not be passive", UMLUtil.getStereotypeApplication(newStateMachine, RTStateMachine.class).isPassive()); Assert.assertTrue("State machine should be contained via the ownedBehavior feature", ((org.eclipse.uml2.uml.Class) targetContainer).getOwnedBehaviors().contains(newStateMachine)); Assert.assertEquals("State machine should be referenced in the behaviorClassifier feature", newStateMachine, ((org.eclipse.uml2.uml.Class) targetContainer).getClassifierBehavior()); @@ -76,7 +78,7 @@ public class CreateRTStateMachineOnCapsuleValidation implements IValidationRule List<Diagram> diagrams = DiagramUtils.getAssociatedDiagrams(newStateMachine, newStateMachine.eResource().getResourceSet()); Assert.assertEquals("There should be one diagram representing the state machine", 1, diagrams.size()); Diagram diagram = diagrams.get(0); - Assert.assertEquals("RTState machine diagram has wrong name", "StateMachine1", diagram.getName()); + Assert.assertEquals("RTState machine diagram has wrong name", null, diagram.getName()); } /** |