diff options
Diffstat (limited to 'tests/junit/umlrt/core')
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()); } /** |