From 897733959c45b227d9bfe38315752128eb6bee2f Mon Sep 17 00:00:00 2001 From: cletavernie Date: Mon, 4 Feb 2013 09:54:10 +0000 Subject: 397389: [Timing Diagram] Papyrus shall support UML2 timing diagram https://bugs.eclipse.org/bugs/show_bug.cgi?id=397389 Move oep.uml.diagram.timing.tests to its final SVN location --- .../.classpath | 7 - .../.gitignore | 1 - .../.project | 28 - .../META-INF/MANIFEST.MF | 22 - .../TODO.txt | 70 -- .../build.properties | 12 - ...eclipse.papyrus.uml.diagram.timing.tests.launch | 45 - .../uml/diagram/timing/tests/Activator.java | 64 -- .../papyrus/uml/diagram/timing/tests/AllTests.java | 24 - .../canonical/AbstractTimingDiagramTestCase.java | 615 ----------- .../timing/tests/canonical/AllCanonicalTests.java | 29 - .../TestTimingDiagramCompactLifeline.java | 95 -- ...imingDiagramCompactOccurrenceSpecification.java | 324 ------ .../TestTimingDiagramCompactStateInvariant.java | 233 ----- .../canonical/TestTimingDiagramFullLifeline.java | 95 -- .../TestTimingDiagramFullLifelineLayout.java | 46 - ...stTimingDiagramFullOccurrenceSpecification.java | 288 ----- .../TestTimingDiagramFullStateInvariant.java | 103 -- .../canonical/TestTimingDiagramInteraction.java | 78 -- .../tests/canonical/TestTimingDiagramMessages.java | 50 - .../TestTimingDiagramStateDefinition.java | 223 ---- .../tests/generic/AbstractPapyrusTestCase.java | 1104 -------------------- 22 files changed, 3556 deletions(-) delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java delete mode 100644 incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java (limited to 'incoming') diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath deleted file mode 100644 index 2d1a4302f04..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore deleted file mode 100644 index e660fd93d31..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin/ diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project deleted file mode 100644 index ea314acb35c..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.uml.diagram.timing.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 73d6e519b34..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Papyrus Timing Diagram Tests (Incubation) -Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.timing.tests -Bundle-Version: 0.10.0.qualifier -Bundle-Activator: org.eclipse.papyrus.uml.diagram.timing.tests.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.junit4;bundle-version="4.8.1", - org.eclipse.papyrus.infra.core;bundle-version="0.9.0", - org.eclipse.papyrus.editor;bundle-version="0.9.0", - org.eclipse.papyrus.uml.diagram.timing;bundle-version="0.9.0", - org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.1", - org.eclipse.papyrus.uml.diagram.common;bundle-version="0.9.0", - org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.0", - org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0", - org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0", - org.eclipse.ui.ide;bundle-version="3.8.0", - org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-Vendor: Eclipse Modeling Project diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt deleted file mode 100644 index dd867480403..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt +++ /dev/null @@ -1,70 +0,0 @@ -remaining tests to write: -- check that full state invariants are positioned in front of their state definition -- test deleting a full state invariant (check that related time elements and general orderings are deleted) -- test hiding a full state invariant (check that related time elements and general orderings are hidden) -- test hiding an occurrence specification in a full lifeline -- test that moving a vertical line moves the preceding occurrence specification -- check that related time elements and general orderings are deleted when deleting a compact occurrence specification -- check that related time elements and general orderings are deleted when deleting a compact state invariant -- test hiding a compact occurrence specification (check that related elements are hidden) -- check that fragment names are updated when changing a state definition name -- check that vertical lines cannot be deleted -- test model consistency when modifying the model from the Model Explorer (delete, rename, ...) -- test reordering Lifelines through drag&drop inside the interaction -- test reordering state definitions through drag&drop inside the state definition compartment -- test creating sync/async/reply Messages (check that OccurrenceSpecifications are converted to MessageOccurrenceSpecifications on the fly) -- test deleting a MessageOccurrenceSpecification (check that the associated Message is deleted) -- test creating a lost message -- test moving a lost message floating anchor -- test creating a found message -- test moving a found message floating anchor -- test re-orienting sync/async/reply Messages -- test re-orienting a create message: everything before the start occurrence must be deleted -- test re-orienting a destroy message: everything after the destruction occurrence must be deleted -- test re-orienting the source of a lost message -- test re-orienting the target of a found message -- test creating a Gate on the border of an Interaction -- test renaming a Gate -- test deleting a Gate (the associated Messages must be deleted) -- test re-orienting a message from/to a Gate -- - -- test creating a create message (full and compact): check that occurrences and state invariants before the start occurrence are deleted -- check that time elements and general orderings are not deleted when creating a create message, unless their related element gets deleted -- check that deleting the start occurrence (from a create message) restores the timeline to normal (full and compact): starting with a StateInvariant -- check that deleting the state invariant immediately after a creation occurrence (that starts the timeline) also deletes the creation occurrence - -- test creating a delete message: check that a DestructionOccurrenceSpecification is created and that other occurrences and state invariants after it are deleted -- check that time elements and general orderings are not deleted when adding a DestructionOccurrenceSpecification, unless their related element gets deleted -- test creating a DestructionOccurrenceSpecification from the palette -- test deleting a DestructionOccurrenceSpecification - -- test creating TimeObservations/TimeConstraints (on occurrence specifications and state invariants) -- test renaming TimeObservations/TimeConstraints -- test deleting TimeObservations/TimeConstraints -- test that changing "firstEvent" on a TimeObservation/TimeConstraint moves the TimeObservation/TimeConstraint -- test that TimeObservations and TimeConstraints have the same horizontal position as the element they are linked to -- test creating DurationObservations/DurationConstraints (on occurrence specifications and state invariants) -- test creating DurationObservation/DurationConstraint from a state invariant to the same state invariant -- test renaming DurationObservations/DurationConstraints -- test deleting DurationObservations/DurationConstraints -- test that a DurationObservation/DurationConstraint on the last StateInvariant is properly positioned -- test that a DurationObservation/DurationConstraint on a StateInvariant is reconnected to the new StateInvariant when cutting the first StateInvariant in two (not yet implemented) -- test that DurationObservations/DurationConstraints have the correct horizontal position and size considering the elements they are linked to -- same thing, on a compact state with occurrences on top of it -- test that in the presence of a DestructionOccurrenceSpecification, DurationObservations/DurationConstraints on the last state end on this DestructionOccurrenceSpecification -- test creating a general ordering -- test renaming a general ordering -- test deleting a general ordering - - -- test dropping lifelines with their covering fragments -- test dropping messages (sync/async/reply/create/delete/lost/found) -- test dropping TimeObservation, TimeConstraint, DurationObservation, DurationConstraint -- test dropping GeneralOrdering -- test dropping Gate -- test dropping non-valid models (to check that validation fixes the model) - -- test stereotypes -- test switching between full and compact lifelines -- test that what works with OccurrenceSpecifications (moving, hiding, deleting, etc.) also works with MessageOccurrenceSpecifications and DestructionOccurrenceSpecifications \ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties deleted file mode 100644 index 6b5ca9799a6..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2012 CEA LIST. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch deleted file mode 100644 index 4df50154270..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java deleted file mode 100644 index 45af84397ed..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.timing.tests; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.timing.tests"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - - @Override - public void start(final BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - - @Override - public void stop(final BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java deleted file mode 100644 index 551c0de1308..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.timing.tests; - -import org.eclipse.papyrus.uml.diagram.timing.tests.canonical.AllCanonicalTests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -//@formatter:off -@RunWith(Suite.class) -@SuiteClasses({ -// canonical -AllCanonicalTests.class }) -//@formatter:on -public class AllTests { - // Junit 4 test case -} diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java deleted file mode 100644 index 9d07531f411..00000000000 --- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java +++ /dev/null @@ -1,615 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - *******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.timing.tests.canonical; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.List; - -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.util.EList; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.commands.ICreationCommand; -import org.eclipse.papyrus.uml.diagram.timing.custom.CreateTimingDiagramCommand; -import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN; -import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart; -import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes; -import org.eclipse.papyrus.uml.diagram.timing.tests.generic.AbstractPapyrusTestCase; -import org.eclipse.uml2.uml.Constraint; -import org.eclipse.uml2.uml.DestructionOccurrenceSpecification; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.OccurrenceSpecification; -import org.eclipse.uml2.uml.OpaqueExpression; -import org.eclipse.uml2.uml.StateInvariant; -import org.eclipse.uml2.uml.ValueSpecification; - -public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase { - - private InteractionEditPartTN interactionEditPart; - - private InteractionCompartmentEditPartTN interactionCompartment; - - private FullLifelineEditPartCN fullLifelineEditPart; - - private CompactLifelineEditPartCN compactLifelineEditPart; - - private FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment; - - private FullLifelineTimelineCompartmentEditPartCN fullLifelineTimelineCompartment; - - private CompactLifelineCompartmentEditPartCN compactLifelineTimelineCompartment; - - @Override - protected ICreationCommand getDiagramCommandCreation() { - return new CreateTimingDiagramCommand(); - } - - /** Creates the default Interaction (use this when only one Interaction will be used in a test) */ - protected void createDefaultInteraction(final Point position, final Dimension size) { - this.interactionEditPart = createInteraction(position, size); - this.interactionCompartment = (InteractionCompartmentEditPartTN)EditPartUtils.findFirstChildEditPartWithId(this.interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID); - assertNotNull("The interaction compartment was not found", this.interactionCompartment); - } - - /** Creates the default Interaction (use this when only one Interaction will be used in a test) */ - protected void createDefaultInteraction() { - createDefaultInteraction(new Point(0, 0), new Dimension(800, 600)); - } - - /** - * Creates the default full Lifeline in the default Interaction (use this when only one Interaction and one Lifeline - * will be used in a test) - */ - protected void createDefaultFullLifeline() { - this.fullLifelineEditPart = createFullLifeline(getDefaultInteractionEditPart()); - this.stateDefinitionCompartment = (FullLifelineStateDefinitionCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.fullLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID); - assertNotNull("The StateDefinition compartment must exist", this.stateDefinitionCompartment); - this.fullLifelineTimelineCompartment = (FullLifelineTimelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.fullLifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID); - assertNotNull("The timeline compartment must exist", this.fullLifelineTimelineCompartment); - } - - /** - * Creates the default compact Lifeline in the default Interaction (use this when only one Interaction and one - * Lifeline will be used in a test) - */ - protected void createDefaultCompactLifeline() { - this.compactLifelineEditPart = createCompactLifeline(getDefaultInteractionEditPart()); - this.compactLifelineTimelineCompartment = (CompactLifelineCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(this.compactLifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID); - assertNotNull("The timeline compartment must exist", this.compactLifelineTimelineCompartment); - } - - /** Creates 3 state definitions in the default Lifeline */ - protected void createThreeStateDefinitionsInDefaultFullLifeline() { - createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment); - createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment); - createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment); - } - - /** - * Creates a new StateDefinition in the default Lifeline using a Request. - * - * @return the created StateDefinition's EditPart - */ - protected StateDefinitionEditPart createStateDefinitionInDefaultFullLifeline() { - return createStateDefinition(getDefaultFullLifelineEditPart()); - } - - /** - * Creates a new StateDefinition in the given Lifeline using a Request. - * - * @return the created StateDefinition's EditPart - */ - protected StateDefinitionEditPart createStateDefinition(final FullLifelineEditPartCN parentLifelineEditPart) { - final FullLifelineStateDefinitionCompartmentEditPartCN compartment = (FullLifelineStateDefinitionCompartmentEditPartCN)EditPartUtils.findFirstChildEditPartWithId(parentLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID); - final View stateDefinitionView = createView(UMLElementTypes.Node_9, compartment); - assertNotNull("The StateDefinition View should be created", stateDefinitionView); - return (StateDefinitionEditPart)findChildEditPartAssociatedToView(compartment, stateDefinitionView); - } - - /** - * Create a new full Lifeline in the default Interaction using a Request. - * - * @return the created full Lifeline's EditPart - */ - protected FullLifelineEditPartCN createFullLifelineInDefaultInteraction() { - return createFullLifeline(getDefaultInteractionEditPart()); - } - - /** - * Create a new full Lifeline in the given Interaction using a Request. - * - * @return the created full Lifeline's EditPart - */ - protected FullLifelineEditPartCN createFullLifeline(final InteractionEditPartTN parentInteractionEditPart) { - final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(parentInteractionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID); - assertNotNull("The compartment must not be null", compartment); - final View view = createView(UMLElementTypes.Lifeline_19, compartment); - assertNotNull("The FullLifeline View should be created", view); - return (FullLifelineEditPartCN)findChildEditPartAssociatedToView(compartment, view); - } - - /** - * Create a new compact Lifeline in the default Interaction using a Request. - * - * @return the created compact Lifeline's EditPart - */ - protected CompactLifelineEditPartCN createCompactLifelineInDefaultInteraction() { - return createCompactLifeline(getDefaultInteractionEditPart()); - } - - /** - * Create a new compact Lifeline in the given Interaction using a Request. - * - * @return the created compact Lifeline's EditPart - */ - protected CompactLifelineEditPartCN createCompactLifeline(final InteractionEditPartTN parentInteractionEditPart) { - final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(parentInteractionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID); - assertNotNull("The compartment must not be null", compartment); - final View view = createView(UMLElementTypes.Lifeline_20, compartment); - assertNotNull("The CompactLifeline View should be created", view); - return (CompactLifelineEditPartCN)findChildEditPartAssociatedToView(compartment, view); - } - - /** - * Create a new Interaction in the default diagram using a Request. - * - * @param location - * the position for the new Interaction - * @param dimension - * the size of the new Interaction - * @return the created Interaction's EditPart - */ - protected InteractionEditPartTN createInteraction(final Point location, final Dimension dimension) { - createView(UMLElementTypes.Interaction_2, location, dimension, getDiagramEditPart()); - final InteractionEditPartTN interactionEditPart = (InteractionEditPartTN)EditPartUtils.findFirstChildEditPartWithId(getDiagramEditPart(), InteractionEditPartTN.VISUAL_ID); - assertNotNull("The interaction EditPart was not found under the diagram EditPart", interactionEditPart); - final InteractionCompartmentEditPartTN interactionCompartment = (InteractionCompartmentEditPartTN)EditPartUtils.findFirstChildEditPartWithId(interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID); - assertNotNull("The interaction compartment was not found", interactionCompartment); - return interactionEditPart; - } - - /** - * Create a new Interaction with a default size in the default diagram using a Request. - * - * @return the created Interaction's EditPart - */ - protected InteractionEditPartTN createInteraction() { - return createInteraction(new Point(0, 0), new Dimension(800, 400)); - } - - /** - * Create three occurrence specifications in the default Lifeline: - *