Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt70
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch45
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java24
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java615
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java29
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java95
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java324
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java233
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java95
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java288
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java103
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java78
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java50
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java223
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java1104
22 files changed, 0 insertions, 3556 deletions
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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.diagram.timing.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.papyrus.infra.table.common,org.eclipse.papyrus.infra.table.controlmode,org.eclipse.papyrus.infra.table.instance,org.eclipse.papyrus.infra.table.menu,org.eclipse.papyrus.infra.table.modelexplorer,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel,org.eclipse.papyrus.infra.table.properties,org.eclipse.papyrus.sysml.table.allocation,org.eclipse.papyrus.sysml.table.requirement,org.eclipse.papyrus.uml.profilefacet,org.eclipse.papyrus.uml.profilefacet.generation,org.eclipse.papyrus.uml.profilefacet.metamodel,org.eclipse.papyrus.uml.table.common,org.eclipse.papyrus.uml.table.default,org.eclipse.papyrus.uml.table.widgets.celleditors,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui,org.eclipse.papyrus.uml.textedit.common.xtext,org.eclipse.papyrus.uml.textedit.common.xtext.ui,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui,org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext,org.eclipse.papyrus.uml.textedit.javaconstraint,org.eclipse.papyrus.uml.textedit.message.xtext,org.eclipse.papyrus.uml.textedit.message.xtext.ui,org.eclipse.papyrus.uml.textedit.parameter.xtext,org.eclipse.papyrus.uml.textedit.parameter.xtext.ui,org.eclipse.papyrus.uml.textedit.property.xtext,org.eclipse.papyrus.uml.textedit.property.xtext.ui,org.eclipse.papyrus.uml.textedit.state.xtext,org.eclipse.papyrus.uml.textedit.state.xtext.ui,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui,org.eclipse.papyrus.uml.textedit.transition.xtext,org.eclipse.papyrus.uml.textedit.transition.xtext.ui"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.uml.diagram.timing.tests.AllTests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.uml.diagram.timing.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m&#13;&#10;-Xmx1024m&#13;&#10;-XX:PermSize=256M&#13;&#10;-XX:MaxPermSize=512M"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<booleanAttribute key="run_in_ui_thread" value="false"/>
-<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.sun.el@default:default,com.sun.syndication@default:default,javax.activation@default:default,javax.annotation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml.bind@default:default,javax.xml.stream@default:default,javax.xml@default:default,lpg.runtime.java@default:default,net.sourceforge.nattable.core@default:default,org.antlr.runtime*3.0.0.v200803061811@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.apache.ant@default:default,org.apache.batik.bridge@default:default,org.apache.batik.css@default:default,org.apache.batik.dom.svg@default:default,org.apache.batik.dom@default:default,org.apache.batik.ext.awt@default:default,org.apache.batik.parser@default:default,org.apache.batik.pdf@default:default,org.apache.batik.svggen@default:default,org.apache.batik.transcoder@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.batik.xml@default:default,org.apache.commons.cli@default:default,org.apache.commons.codec@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.jasper.glassfish@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.ws.commons.util@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.apache.xmlrpc@default:default,org.eclipse.acceleo.common@default:default,org.eclipse.acceleo.engine@default:default,org.eclipse.acceleo.model@default:default,org.eclipse.acceleo.profiler@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.launching@default:default,org.eclipse.ant.ui@default:default,org.eclipse.b3.aggregator.legacy@default:default,org.eclipse.b3.aggregator@default:default,org.eclipse.b3.cli@default:default,org.eclipse.b3.p2@default:default,org.eclipse.b3.util@default:default,org.eclipse.compare.core@default:default,org.eclipse.compare.win32@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.cvs@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.draw2d.doc.isv@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.egit.core@default:default,org.eclipse.egit.doc@default:default,org.eclipse.egit.ui@default:default,org.eclipse.egit@default:default,org.eclipse.emf.ant@default:default,org.eclipse.emf.cheatsheets@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.emf.codegen.ui@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.compare.ide@default:default,org.eclipse.emf.compare.uml2@default:default,org.eclipse.emf.compare@default:default,org.eclipse.emf.converter@default:default,org.eclipse.emf.databinding.edit@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.doc@default:default,org.eclipse.emf.ecore.change.edit@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.emf.example.installer@default:default,org.eclipse.emf.exporter@default:default,org.eclipse.emf.facet.aggregate.doc@default:default,org.eclipse.emf.facet.aggregate.metamodel.notgenerated@default:default,org.eclipse.emf.facet.aggregate.metamodel@default:default,org.eclipse.emf.facet.capabilities@default:default,org.eclipse.emf.facet.common.core@default:default,org.eclipse.emf.facet.common.sdk.core@default:default,org.eclipse.emf.facet.common.sdk.ui@default:default,org.eclipse.emf.facet.common.ui@default:default,org.eclipse.emf.facet.custom.core@default:default,org.eclipse.emf.facet.custom.doc@default:default,org.eclipse.emf.facet.custom.metamodel.edit@default:default,org.eclipse.emf.facet.custom.metamodel.editor@default:default,org.eclipse.emf.facet.custom.metamodel@default:default,org.eclipse.emf.facet.custom.sdk.core@default:default,org.eclipse.emf.facet.custom.sdk.ui@default:default,org.eclipse.emf.facet.custom.ui@default:default,org.eclipse.emf.facet.doc@default:default,org.eclipse.emf.facet.ecore@default:default,org.eclipse.emf.facet.efacet.catalog@default:default,org.eclipse.emf.facet.efacet.core@default:default,org.eclipse.emf.facet.efacet.doc@default:default,org.eclipse.emf.facet.efacet.edit@default:default,org.eclipse.emf.facet.efacet.editor@default:default,org.eclipse.emf.facet.efacet.examples.library.core@default:default,org.eclipse.emf.facet.efacet.examples.library.metamodel.edit@default:default,org.eclipse.emf.facet.efacet.examples.library.metamodel@default:default,org.eclipse.emf.facet.efacet.metamodel.edit@default:default,org.eclipse.emf.facet.efacet.metamodel.editor@default:default,org.eclipse.emf.facet.efacet.metamodel@default:default,org.eclipse.emf.facet.efacet.sdk.ui@default:default,org.eclipse.emf.facet.efacet.ui@default:default,org.eclipse.emf.facet.efacet@default:default,org.eclipse.emf.facet.infra.browser.custom.core@default:default,org.eclipse.emf.facet.infra.browser.custom.edit@default:default,org.eclipse.emf.facet.infra.browser.custom.editor@default:default,org.eclipse.emf.facet.infra.browser.custom.examples.uml@default:default,org.eclipse.emf.facet.infra.browser.custom.ui@default:default,org.eclipse.emf.facet.infra.browser.custom@default:default,org.eclipse.emf.facet.infra.browser.doc@default:default,org.eclipse.emf.facet.infra.browser.uicore.examples.cnf@default:default,org.eclipse.emf.facet.infra.browser.uicore@default:default,org.eclipse.emf.facet.infra.browser@default:default,org.eclipse.emf.facet.infra.common.core@default:default,org.eclipse.emf.facet.infra.common.ui@default:default,org.eclipse.emf.facet.infra.facet.core@default:default,org.eclipse.emf.facet.infra.facet.edit@default:default,org.eclipse.emf.facet.infra.facet.editor@default:default,org.eclipse.emf.facet.infra.facet.ui@default:default,org.eclipse.emf.facet.infra.facet@default:default,org.eclipse.emf.facet.infra.query.core@default:default,org.eclipse.emf.facet.infra.query.edit@default:default,org.eclipse.emf.facet.infra.query.editor@default:default,org.eclipse.emf.facet.infra.query.ui@default:default,org.eclipse.emf.facet.infra.query@default:default,org.eclipse.emf.facet.query.java.core@default:default,org.eclipse.emf.facet.query.java.metamodel@default:default,org.eclipse.emf.facet.query.java.sdk.ui@default:default,org.eclipse.emf.facet.query.java.ui@default:default,org.eclipse.emf.facet.query.java@default:default,org.eclipse.emf.facet.query.ocl.core@default:default,org.eclipse.emf.facet.query.ocl.metamodel@default:default,org.eclipse.emf.facet.query.ocl.sdk.ui@default:default,org.eclipse.emf.facet.util.core@default:default,org.eclipse.emf.facet.util.emf.catalog@default:default,org.eclipse.emf.facet.util.emf.core@default:default,org.eclipse.emf.facet.util.emf.doc@default:default,org.eclipse.emf.facet.util.emf.ui@default:default,org.eclipse.emf.facet.util.ui@default:default,org.eclipse.emf.facet.widgets.celleditors.ecore.tests.samplemm@default:default,org.eclipse.emf.facet.widgets.celleditors.ecore@default:default,org.eclipse.emf.facet.widgets.celleditors.edit@default:default,org.eclipse.emf.facet.widgets.celleditors.editor@default:default,org.eclipse.emf.facet.widgets.celleditors@default:default,org.eclipse.emf.facet.widgets.nattable.doc@default:default,org.eclipse.emf.facet.widgets.nattable.examples.ecore@default:default,org.eclipse.emf.facet.widgets.nattable.instance.edit@default:default,org.eclipse.emf.facet.widgets.nattable.instance@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration.edit@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration.editor@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration@default:default,org.eclipse.emf.facet.widgets.nattable.workbench@default:default,org.eclipse.emf.facet.widgets.nattable@default:default,org.eclipse.emf.facet.widgets.table.doc@default:default,org.eclipse.emf.facet.widgets.table.examples.library.core@default:default,org.eclipse.emf.facet.widgets.table.metamodel.edit@default:default,org.eclipse.emf.facet.widgets.table.metamodel@default:default,org.eclipse.emf.facet.widgets.table.ui.nattable@default:default,org.eclipse.emf.facet.widgets.table.ui.workbench@default:default,org.eclipse.emf.facet.widgets.table.ui@default:default,org.eclipse.emf.facet.widgets@default:default,org.eclipse.emf.generic.editor@default:default,org.eclipse.emf.importer.ecore@default:default,org.eclipse.emf.importer.java@default:default,org.eclipse.emf.importer.rose@default:default,org.eclipse.emf.importer@default:default,org.eclipse.emf.mapping.ecore.editor@default:default,org.eclipse.emf.mapping.ecore2ecore.editor@default:default,org.eclipse.emf.mapping.ecore2ecore@default:default,org.eclipse.emf.mapping.ecore2xml.ui@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.emf.mapping.ecore@default:default,org.eclipse.emf.mapping.ui@default:default,org.eclipse.emf.mapping@default:default,org.eclipse.emf.mwe.core@default:default,org.eclipse.emf.mwe.ui@default:default,org.eclipse.emf.mwe.utils@default:default,org.eclipse.emf.mwe2.language.ui@default:default,org.eclipse.emf.mwe2.language@default:default,org.eclipse.emf.mwe2.launch@default:default,org.eclipse.emf.mwe2.lib@default:default,org.eclipse.emf.mwe2.runtime@default:default,org.eclipse.emf.transaction.doc@default:default,org.eclipse.emf.transaction.examples@default:default,org.eclipse.emf.transaction.ui@default:default,org.eclipse.emf.transaction@default:default,org.eclipse.emf.validation.doc@default:default,org.eclipse.emf.validation.examples@default:default,org.eclipse.emf.validation.ocl@default:default,org.eclipse.emf.validation.ui.ide@default:default,org.eclipse.emf.validation.ui@default:default,org.eclipse.emf.validation@default:default,org.eclipse.emf.workspace.doc@default:default,org.eclipse.emf.workspace.ui@default:default,org.eclipse.emf.workspace@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.equinox.launcher.win32.win32.x86_64@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.p2.ui.importexport@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.gef.doc.isv@default:default,org.eclipse.gef.examples.ui.pde@default:default,org.eclipse.gef@default:default,org.eclipse.gmf.bridge.trace@default:default,org.eclipse.gmf.bridge.ui.dashboard@default:default,org.eclipse.gmf.bridge.ui@default:default,org.eclipse.gmf.bridge@default:default,org.eclipse.gmf.codegen.edit@default:default,org.eclipse.gmf.codegen.ui@default:default,org.eclipse.gmf.codegen@default:default,org.eclipse.gmf.common@default:default,org.eclipse.gmf.doc.ui@default:default,org.eclipse.gmf.doc@default:default,org.eclipse.gmf.ecore.editor@default:default,org.eclipse.gmf.examples.runtime.ui.pde@default:default,org.eclipse.gmf.graphdef.codegen.ui@default:default,org.eclipse.gmf.graphdef.codegen@default:default,org.eclipse.gmf.graphdef.edit@default:default,org.eclipse.gmf.graphdef@default:default,org.eclipse.gmf.map.edit@default:default,org.eclipse.gmf.map@default:default,org.eclipse.gmf.runtime.common.core@default:default,org.eclipse.gmf.runtime.common.ui.action.ide@default:default,org.eclipse.gmf.runtime.common.ui.action@default:default,org.eclipse.gmf.runtime.common.ui.printing.win32@default:false,org.eclipse.gmf.runtime.common.ui.printing@default:default,org.eclipse.gmf.runtime.common.ui.services.action@default:default,org.eclipse.gmf.runtime.common.ui.services.dnd.ide@default:default,org.eclipse.gmf.runtime.common.ui.services.dnd@default:default,org.eclipse.gmf.runtime.common.ui.services.properties@default:default,org.eclipse.gmf.runtime.common.ui.services@default:default,org.eclipse.gmf.runtime.common.ui@default:default,org.eclipse.gmf.runtime.diagram.core@default:default,org.eclipse.gmf.runtime.diagram.ui.actions@default:default,org.eclipse.gmf.runtime.diagram.ui.dnd@default:default,org.eclipse.gmf.runtime.diagram.ui.geoshapes@default:default,org.eclipse.gmf.runtime.diagram.ui.printing.render@default:default,org.eclipse.gmf.runtime.diagram.ui.printing@default:default,org.eclipse.gmf.runtime.diagram.ui.properties@default:default,org.eclipse.gmf.runtime.diagram.ui.providers.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.providers@default:default,org.eclipse.gmf.runtime.diagram.ui.render@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor@default:default,org.eclipse.gmf.runtime.diagram.ui@default:default,org.eclipse.gmf.runtime.draw2d.ui.render.awt@default:default,org.eclipse.gmf.runtime.draw2d.ui.render@default:default,org.eclipse.gmf.runtime.draw2d.ui@default:default,org.eclipse.gmf.runtime.emf.clipboard.core@default:default,org.eclipse.gmf.runtime.emf.commands.core@default:default,org.eclipse.gmf.runtime.emf.core@default:default,org.eclipse.gmf.runtime.emf.type.core@default:default,org.eclipse.gmf.runtime.emf.type.ui@default:default,org.eclipse.gmf.runtime.emf.ui.properties@default:default,org.eclipse.gmf.runtime.emf.ui@default:default,org.eclipse.gmf.runtime.gef.ui@default:default,org.eclipse.gmf.runtime.notation.edit@default:default,org.eclipse.gmf.runtime.notation.providers@default:default,org.eclipse.gmf.runtime.notation.sdk@default:default,org.eclipse.gmf.runtime.notation@default:default,org.eclipse.gmf.runtime.sdk@default:default,org.eclipse.gmf.sdk@default:default,org.eclipse.gmf.tooldef.edit@default:default,org.eclipse.gmf.tooldef@default:default,org.eclipse.gmf.tooling.runtime@default:default,org.eclipse.gmf.tooling@default:default,org.eclipse.gmf.validate@default:default,org.eclipse.gmf.xpand.editor@default:default,org.eclipse.gmf.xpand.qvtlibrary@default:default,org.eclipse.gmf.xpand@default:default,org.eclipse.gmf@default:default,org.eclipse.gmt.modisco.infra.common.core@default:default,org.eclipse.gmt.modisco.infra.common.ui@default:default,org.eclipse.gmt.modisco.infra.discoverymanager@default:default,org.eclipse.gmt.modisco.xml.discoverer@default:default,org.eclipse.gmt.modisco.xml@default:default,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help.webapp@default:default,org.eclipse.help@default:default,org.eclipse.jdt.annotation@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.jdt.apt.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit4.runtime@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.jem.util@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jgit@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.m2m.qvt.oml.common.ui@default:default,org.eclipse.m2m.qvt.oml.common@default:default,org.eclipse.m2m.qvt.oml.cst.parser@default:default,org.eclipse.m2m.qvt.oml.debug.core@default:default,org.eclipse.m2m.qvt.oml.debug.ui@default:default,org.eclipse.m2m.qvt.oml.doc@default:default,org.eclipse.m2m.qvt.oml.ecore.imperativeocl@default:default,org.eclipse.m2m.qvt.oml.editor.ui@default:default,org.eclipse.m2m.qvt.oml.emf.util.ui@default:default,org.eclipse.m2m.qvt.oml.emf.util@default:default,org.eclipse.m2m.qvt.oml.ocl@default:default,org.eclipse.m2m.qvt.oml.project@default:default,org.eclipse.m2m.qvt.oml.runtime.ui@default:default,org.eclipse.m2m.qvt.oml.runtime@default:default,org.eclipse.m2m.qvt.oml.samples@default:default,org.eclipse.m2m.qvt.oml.trace.edit@default:default,org.eclipse.m2m.qvt.oml.ui@default:default,org.eclipse.m2m.qvt.oml@default:default,org.eclipse.modisco.infra.discovery.core@default:default,org.eclipse.modisco.infra.discovery.ui@default:default,org.eclipse.modisco.infra.discovery@default:default,org.eclipse.modisco.xml.discoverer@default:default,org.eclipse.mylyn.bugzilla.core@default:default,org.eclipse.mylyn.bugzilla.ui@default:default,org.eclipse.mylyn.commons.core@default:default,org.eclipse.mylyn.commons.identity.core@default:default,org.eclipse.mylyn.commons.identity@default:default,org.eclipse.mylyn.commons.net@default:default,org.eclipse.mylyn.commons.notifications.core@default:default,org.eclipse.mylyn.commons.notifications.feed@default:default,org.eclipse.mylyn.commons.notifications.ui@default:default,org.eclipse.mylyn.commons.notifications@default:default,org.eclipse.mylyn.commons.repositories.core@default:default,org.eclipse.mylyn.commons.repositories.ui@default:default,org.eclipse.mylyn.commons.repositories@default:default,org.eclipse.mylyn.commons.screenshots@default:default,org.eclipse.mylyn.commons.team@default:default,org.eclipse.mylyn.commons.ui@default:default,org.eclipse.mylyn.commons.workbench@default:default,org.eclipse.mylyn.commons.xmlrpc@default:default,org.eclipse.mylyn.context.core@default:default,org.eclipse.mylyn.context.tasks.ui@default:default,org.eclipse.mylyn.context.ui@default:default,org.eclipse.mylyn.discovery.core@default:default,org.eclipse.mylyn.discovery.ui@default:default,org.eclipse.mylyn.monitor.core@default:default,org.eclipse.mylyn.monitor.ui@default:default,org.eclipse.mylyn.resources.ui@default:default,org.eclipse.mylyn.tasks.core@default:default,org.eclipse.mylyn.tasks.index.core@default:default,org.eclipse.mylyn.tasks.index.ui@default:default,org.eclipse.mylyn.tasks.search@default:default,org.eclipse.mylyn.tasks.ui@default:default,org.eclipse.mylyn.wikitext.confluence.core@default:default,org.eclipse.mylyn.wikitext.confluence.ui@default:default,org.eclipse.mylyn.wikitext.core@default:default,org.eclipse.mylyn.wikitext.help.ui@default:default,org.eclipse.mylyn.wikitext.mediawiki.core@default:default,org.eclipse.mylyn.wikitext.mediawiki.ui@default:default,org.eclipse.mylyn.wikitext.tasks.ui@default:default,org.eclipse.mylyn.wikitext.textile.core@default:default,org.eclipse.mylyn.wikitext.textile.ui@default:default,org.eclipse.mylyn.wikitext.tracwiki.core@default:default,org.eclipse.mylyn.wikitext.tracwiki.ui@default:default,org.eclipse.mylyn.wikitext.twiki.core@default:default,org.eclipse.mylyn.wikitext.twiki.ui@default:default,org.eclipse.mylyn.wikitext.ui@default:default,org.eclipse.ocl.common.ui@default:default,org.eclipse.ocl.common@default:default,org.eclipse.ocl.doc@default:default,org.eclipse.ocl.ecore.edit@default:default,org.eclipse.ocl.ecore@default:default,org.eclipse.ocl.edit@default:default,org.eclipse.ocl.examples.common@default:default,org.eclipse.ocl.examples.domain@default:default,org.eclipse.ocl.examples.library@default:default,org.eclipse.ocl.examples.pivot@default:default,org.eclipse.ocl.examples.xtext.base@default:default,org.eclipse.ocl.examples.xtext.console@default:default,org.eclipse.ocl.examples.xtext.essentialocl.ui@default:default,org.eclipse.ocl.examples.xtext.essentialocl@default:default,org.eclipse.ocl.ui@default:default,org.eclipse.ocl.uml.edit@default:default,org.eclipse.ocl.uml.ui@default:default,org.eclipse.ocl.uml@default:default,org.eclipse.ocl@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.eclipse.pde.api.tools.ui@default:default,org.eclipse.pde.api.tools@default:default,org.eclipse.pde.build@default:default,org.eclipse.pde.core@default:default,org.eclipse.pde.doc.user@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.pde.launching@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.pde.ui@default:default,org.eclipse.pde@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.platform@default:default,org.eclipse.rcp@default:default,org.eclipse.sdk@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.team.svn.core@default:default,org.eclipse.team.svn.help@default:default,org.eclipse.team.svn.ui@default:default,org.eclipse.team.svn@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.net@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.uml2.codegen.ecore.ui@default:default,org.eclipse.uml2.codegen.ecore@default:default,org.eclipse.uml2.common.edit@default:default,org.eclipse.uml2.common@default:default,org.eclipse.uml2.doc@default:default,org.eclipse.uml2.examples.uml.ui@default:default,org.eclipse.uml2.examples@default:default,org.eclipse.uml2.types@default:default,org.eclipse.uml2.uml.ecore.exporter@default:default,org.eclipse.uml2.uml.ecore.importer@default:default,org.eclipse.uml2.uml.edit@default:default,org.eclipse.uml2.uml.editor@default:default,org.eclipse.uml2.uml.profile.l2@default:default,org.eclipse.uml2.uml.profile.l3@default:default,org.eclipse.uml2.uml.resources@default:default,org.eclipse.uml2.uml@default:default,org.eclipse.uml2@default:default,org.eclipse.update.configurator@3:true,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.xpand.activities@default:default,org.eclipse.xpand.doc@default:default,org.eclipse.xpand.examples@default:default,org.eclipse.xpand.ui@default:default,org.eclipse.xpand@default:default,org.eclipse.xsd@default:default,org.eclipse.xtend.check.ui@default:default,org.eclipse.xtend.core@default:default,org.eclipse.xtend.doc@default:default,org.eclipse.xtend.examples@default:default,org.eclipse.xtend.ide@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtend.m2e@default:default,org.eclipse.xtend.macro.lang.ui@default:default,org.eclipse.xtend.macro.lang@default:default,org.eclipse.xtend.macro@default:default,org.eclipse.xtend.profiler@default:default,org.eclipse.xtend.shared.ui@default:default,org.eclipse.xtend.typesystem.emf.ui@default:default,org.eclipse.xtend.typesystem.emf@default:default,org.eclipse.xtend.typesystem.uml2.ui@default:default,org.eclipse.xtend.typesystem.uml2@default:default,org.eclipse.xtend.typesystem.xsd.ui@default:default,org.eclipse.xtend.typesystem.xsd@default:default,org.eclipse.xtend.ui@default:default,org.eclipse.xtend.util.stdlib@default:default,org.eclipse.xtend2.lib@default:default,org.eclipse.xtend@default:default,org.eclipse.xtext.activities@default:default,org.eclipse.xtext.builder@default:default,org.eclipse.xtext.common.types.edit@default:default,org.eclipse.xtext.common.types.shared.jdt38@default:false,org.eclipse.xtext.common.types.shared@default:default,org.eclipse.xtext.common.types.ui@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.doc@default:default,org.eclipse.xtext.ecore@default:default,org.eclipse.xtext.generator@default:default,org.eclipse.xtext.gmf.glue@default:default,org.eclipse.xtext.junit4@default:default,org.eclipse.xtext.junit@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.purexbase.ui@default:default,org.eclipse.xtext.purexbase@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.ui.codetemplates.ui@default:default,org.eclipse.xtext.ui.codetemplates@default:default,org.eclipse.xtext.ui.ecore@default:default,org.eclipse.xtext.ui.junit@default:default,org.eclipse.xtext.ui.shared@default:default,org.eclipse.xtext.ui@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.junit@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase.ui@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext.xtend@default:default,org.eclipse.xtext.xtext.ui.examples@default:default,org.eclipse.xtext.xtext.ui.graph@default:default,org.eclipse.xtext.xtext.ui@default:default,org.eclipse.xtext@default:default,org.eclipse.zest.core@default:default,org.eclipse.zest.doc.isv@default:default,org.eclipse.zest.layouts@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.jsoup@default:default,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.junit*4.10.0.v4_10_0_v20120426-0900@default:default,org.junit4@default:default,org.kohsuke.args4j@default:default,org.objectweb.asm@default:default,org.polarion.eclipse.team.svn.connector.svnkit17@default:default,org.polarion.eclipse.team.svn.connector@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.0.v200806040011@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.facet.releng.tools@default:default,org.eclipse.epf.common.html@default:default,org.eclipse.epf.common.ui@default:default,org.eclipse.epf.common.win32.win32.x86_64@default:default,org.eclipse.epf.common@default:default,org.eclipse.epf.richtext@default:default,org.eclipse.papyrus.bundles.tests@default:default,org.eclipse.papyrus.core.queries.configuration.tests@default:default,org.eclipse.papyrus.core.queries.test@default:default,org.eclipse.papyrus.core.resourceloading.tests@default:false,org.eclipse.papyrus.core.tests@default:false,org.eclipse.papyrus.customization.palette@default:default,org.eclipse.papyrus.customization.paletteconfiguration@default:default,org.eclipse.papyrus.customization.properties.generation@default:default,org.eclipse.papyrus.customization.properties.model.xwt@default:default,org.eclipse.papyrus.customization.properties.tests@default:default,org.eclipse.papyrus.customization.properties@default:default,org.eclipse.papyrus.customization@default:default,org.eclipse.papyrus.def@default:default,org.eclipse.papyrus.dev.project.management@default:default,org.eclipse.papyrus.diagram.clazz.tests@default:default,org.eclipse.papyrus.diagram.common.tests@default:false,org.eclipse.papyrus.diagram.stereotypeproperty.tests@default:default,org.eclipse.papyrus.diagram.tests@default:default,org.eclipse.papyrus.diagramtemplate.doc@default:default,org.eclipse.papyrus.diagramtemplate.edit@default:default,org.eclipse.papyrus.diagramtemplate.editor@default:default,org.eclipse.papyrus.diagramtemplate@default:default,org.eclipse.papyrus.documentation.plugin@default:default,org.eclipse.papyrus.domaincodegen.ui@default:default,org.eclipse.papyrus.domaincontextcodegen.edit@default:default,org.eclipse.papyrus.domaincontextcodegen.editor@default:default,org.eclipse.papyrus.domaincontextcodegen@default:default,org.eclipse.papyrus.dsml.validation.generation.commands.ui@default:default,org.eclipse.papyrus.dsml.validation.generator@default:default,org.eclipse.papyrus.dsml.validation.model@default:default,org.eclipse.papyrus.dsml.validation.properties@default:default,org.eclipse.papyrus.dsml.validation.wizard@default:default,org.eclipse.papyrus.dsml.validation@default:default,org.eclipse.papyrus.eclipse.project.editors@default:default,org.eclipse.papyrus.editor.perspectiveconfiguration@default:default,org.eclipse.papyrus.editor@default:default,org.eclipse.papyrus.emf.commandstack@default:default,org.eclipse.papyrus.example.text.instance@default:default,org.eclipse.papyrus.extendedtypes.tests@default:false,org.eclipse.papyrus.extensionpoints.editors@default:default,org.eclipse.papyrus.infra.constraints.edit@default:default,org.eclipse.papyrus.infra.constraints.editor@default:default,org.eclipse.papyrus.infra.constraints@default:default,org.eclipse.papyrus.infra.core.log@default:default,org.eclipse.papyrus.infra.core.sasheditor.di.tests@default:false,org.eclipse.papyrus.infra.core.sasheditor.di@default:default,org.eclipse.papyrus.infra.core.sasheditor.tests@default:false,org.eclipse.papyrus.infra.core.sasheditor@default:default,org.eclipse.papyrus.infra.core.serviceregistry.edit@default:default,org.eclipse.papyrus.infra.core.serviceregistry.editor@default:default,org.eclipse.papyrus.infra.core.serviceregistry.tests@default:false,org.eclipse.papyrus.infra.core.serviceregistry@default:default,org.eclipse.papyrus.infra.core@default:default,org.eclipse.papyrus.infra.discovery.ui.menu@default:default,org.eclipse.papyrus.infra.discovery.ui@default:default,org.eclipse.papyrus.infra.discovery@default:default,org.eclipse.papyrus.infra.emf.appearance@default:default,org.eclipse.papyrus.infra.emf.compare.common@default:default,org.eclipse.papyrus.infra.emf.compare.diff@default:default,org.eclipse.papyrus.infra.emf.compare.instance@default:default,org.eclipse.papyrus.infra.emf.compare.ui@default:default,org.eclipse.papyrus.infra.emf.diagram.common@default:default,org.eclipse.papyrus.infra.emf.editor@default:default,org.eclipse.papyrus.infra.emf.embeddededitor@default:default,org.eclipse.papyrus.infra.emf.facet.queries@default:default,org.eclipse.papyrus.infra.emf.images.test@default:default,org.eclipse.papyrus.infra.emf.images@default:default,org.eclipse.papyrus.infra.emf.newchild@default:default,org.eclipse.papyrus.infra.emf.readonly@default:default,org.eclipse.papyrus.infra.emf.tests@default:false,org.eclipse.papyrus.infra.emf@default:default,org.eclipse.papyrus.infra.export@default:default,org.eclipse.papyrus.infra.extendedtypes.emf@default:default,org.eclipse.papyrus.infra.extendedtypes@default:default,org.eclipse.papyrus.infra.gmfdiag.commands@default:default,org.eclipse.papyrus.infra.gmfdiag.common@default:default,org.eclipse.papyrus.infra.gmfdiag.css.configuration@default:default,org.eclipse.papyrus.infra.gmfdiag.css.export@default:default,org.eclipse.papyrus.infra.gmfdiag.css.model@default:default,org.eclipse.papyrus.infra.gmfdiag.css.palette@default:default,org.eclipse.papyrus.infra.gmfdiag.css.properties@default:default,org.eclipse.papyrus.infra.gmfdiag.css.tests@default:default,org.eclipse.papyrus.infra.gmfdiag.css.theme@default:default,org.eclipse.papyrus.infra.gmfdiag.css.xtext.ui@default:default,org.eclipse.papyrus.infra.gmfdiag.css.xtext@default:default,org.eclipse.papyrus.infra.gmfdiag.css@default:default,org.eclipse.papyrus.infra.gmfdiag.dnd@default:default,org.eclipse.papyrus.infra.gmfdiag.hyperlink@default:default,org.eclipse.papyrus.infra.gmfdiag.modelexplorer@default:default,org.eclipse.papyrus.infra.gmfdiag.navigation@default:default,org.eclipse.papyrus.infra.gmfdiag.outline@default:default,org.eclipse.papyrus.infra.gmfdiag.preferences@default:default,org.eclipse.papyrus.infra.gmfdiag.properties@default:default,org.eclipse.papyrus.infra.gmfdiag.widgets@default:default,org.eclipse.papyrus.infra.hyperlink@default:default,org.eclipse.papyrus.infra.onefile@default:default,org.eclipse.papyrus.infra.queries.core.configuration.edit@default:default,org.eclipse.papyrus.infra.queries.core.configuration@default:default,org.eclipse.papyrus.infra.queries.core@default:default,org.eclipse.papyrus.infra.services.controlmode.history@default:default,org.eclipse.papyrus.infra.services.controlmode@default:default,org.eclipse.papyrus.infra.services.decoration@default:default,org.eclipse.papyrus.infra.services.edit.tests@default:false,org.eclipse.papyrus.infra.services.edit@default:default,org.eclipse.papyrus.infra.services.image@default:default,org.eclipse.papyrus.infra.services.labelprovider.tests@default:default,org.eclipse.papyrus.infra.services.labelprovider@default:default,org.eclipse.papyrus.infra.services.markerlistener@default:default,org.eclipse.papyrus.infra.services.resourceloading.preferences@default:default,org.eclipse.papyrus.infra.services.resourceloading@default:default,org.eclipse.papyrus.infra.services.semantic@default:default,org.eclipse.papyrus.infra.services.validation@default:default,org.eclipse.papyrus.infra.tools@default:default,org.eclipse.papyrus.infra.ui.resources@default:default,org.eclipse.papyrus.infra.widgets.toolbox@default:default,org.eclipse.papyrus.infra.widgets@default:default,org.eclipse.papyrus.junit.utils@default:default,org.eclipse.papyrus.marte.properties@default:default,org.eclipse.papyrus.marte.static.profile@default:default,org.eclipse.papyrus.marte.textedit.constraintwithvsl.xtext@default:default,org.eclipse.papyrus.marte.textedit.stereotypeapplicationwithvsl.xtext@default:default,org.eclipse.papyrus.marte.vsl@default:default,org.eclipse.papyrus.migration.properties.model@default:default,org.eclipse.papyrus.outline.emftree@default:default,org.eclipse.papyrus.paletteconfiguration.tests@default:false,org.eclipse.papyrus.sysml.diagram.blockdefinition.tests@default:false,org.eclipse.papyrus.sysml.diagram.blockdefinition@default:default,org.eclipse.papyrus.sysml.diagram.common@default:default,org.eclipse.papyrus.sysml.diagram.internalblock.tests@default:false,org.eclipse.papyrus.sysml.diagram.internalblock@default:default,org.eclipse.papyrus.sysml.diagram.requirement@default:default,org.eclipse.papyrus.sysml.diagram.ui@default:default,org.eclipse.papyrus.sysml.edit@default:default,org.eclipse.papyrus.sysml.facets@default:default,org.eclipse.papyrus.sysml.modelexplorer.tests@default:false,org.eclipse.papyrus.sysml.modelexplorer@default:default,org.eclipse.papyrus.sysml.properties@default:default,org.eclipse.papyrus.sysml.service.types.tests@default:false,org.eclipse.papyrus.sysml.service.types@default:default,org.eclipse.papyrus.sysml.tests@default:default,org.eclipse.papyrus.sysml@default:default,org.eclipse.papyrus.team.svn@default:default,org.eclipse.papyrus.tests.extra@default:default,org.eclipse.papyrus.tests@default:default,org.eclipse.papyrus.uml.alf.ui@default:default,org.eclipse.papyrus.uml.alf@default:default,org.eclipse.papyrus.uml.appearance@default:default,org.eclipse.papyrus.uml.commands@default:default,org.eclipse.papyrus.uml.compare.diff.tests@default:default,org.eclipse.papyrus.uml.compare.diff@default:default,org.eclipse.papyrus.uml.compare.file.tests@default:default,org.eclipse.papyrus.uml.compare.file@default:default,org.eclipse.papyrus.uml.compare.tests@default:default,org.eclipse.papyrus.uml.compare@default:default,org.eclipse.papyrus.uml.controlmode.profile@default:default,org.eclipse.papyrus.uml.diagram.activity.tests@default:default,org.eclipse.papyrus.uml.diagram.activity@default:default,org.eclipse.papyrus.uml.diagram.clazz@default:default,org.eclipse.papyrus.uml.diagram.common.groups@default:default,org.eclipse.papyrus.uml.diagram.common.palette.customaction@default:default,org.eclipse.papyrus.uml.diagram.common@default:default,org.eclipse.papyrus.uml.diagram.communication@default:default,org.eclipse.papyrus.uml.diagram.component@default:default,org.eclipse.papyrus.uml.diagram.composite@default:default,org.eclipse.papyrus.uml.diagram.deployment@default:default,org.eclipse.papyrus.uml.diagram.dnd.tests@default:default,org.eclipse.papyrus.uml.diagram.dnd@default:default,org.eclipse.papyrus.uml.diagram.emftree@default:default,org.eclipse.papyrus.uml.diagram.icons@default:default,org.eclipse.papyrus.uml.diagram.menu@default:default,org.eclipse.papyrus.uml.diagram.modelexplorer@default:default,org.eclipse.papyrus.uml.diagram.navigation@default:default,org.eclipse.papyrus.uml.diagram.package@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration@default:default,org.eclipse.papyrus.uml.diagram.profile@default:default,org.eclipse.papyrus.uml.diagram.sequence.tests@default:default,org.eclipse.papyrus.uml.diagram.sequence@default:default,org.eclipse.papyrus.uml.diagram.statemachine@default:default,org.eclipse.papyrus.uml.diagram.timing.tests@default:default,org.eclipse.papyrus.uml.diagram.timing@default:default,org.eclipse.papyrus.uml.diagram.usecase.tests@default:default,org.eclipse.papyrus.uml.diagram.usecase@default:default,org.eclipse.papyrus.uml.diagram.wizards@default:default,org.eclipse.papyrus.uml.documentation.profile@default:default,org.eclipse.papyrus.uml.documentation@default:default,org.eclipse.papyrus.uml.efacet@default:default,org.eclipse.papyrus.uml.export@default:default,org.eclipse.papyrus.uml.extensionpoints@default:default,org.eclipse.papyrus.uml.icons@default:default,org.eclipse.papyrus.uml.import@default:default,org.eclipse.papyrus.uml.modelexplorer.tests@default:default,org.eclipse.papyrus.uml.modelexplorer.widgets@default:default,org.eclipse.papyrus.uml.modelexplorer@default:default,org.eclipse.papyrus.uml.oclconstraintevaluation@default:default,org.eclipse.papyrus.uml.pastemanager@default:default,org.eclipse.papyrus.uml.perspective@default:default,org.eclipse.papyrus.uml.profile@default:default,org.eclipse.papyrus.uml.properties.tabbedproperties.comments@default:default,org.eclipse.papyrus.uml.properties@default:default,org.eclipse.papyrus.uml.resourceloading.profile@default:default,org.eclipse.papyrus.uml.service.types.tests@default:false,org.eclipse.papyrus.uml.service.types@default:default,org.eclipse.papyrus.uml.standard.edit@default:default,org.eclipse.papyrus.uml.standard@default:default,org.eclipse.papyrus.uml.templaterepository@default:default,org.eclipse.papyrus.uml.tools.extendedtypes@default:default,org.eclipse.papyrus.uml.tools.tests@default:default,org.eclipse.papyrus.uml.tools.utils@default:default,org.eclipse.papyrus.uml.tools@default:default,org.eclipse.papyrus.uml.ui.perspectiveconfiguration@default:default,org.eclipse.papyrus.views.documentation.view.papyrus@default:default,org.eclipse.papyrus.views.documentation.view@default:default,org.eclipse.papyrus.views.documentation@default:default,org.eclipse.papyrus.views.modelexplorer.resourceloading@default:default,org.eclipse.papyrus.views.modelexplorer.tests@default:default,org.eclipse.papyrus.views.modelexplorer.widgets@default:default,org.eclipse.papyrus.views.modelexplorer@default:default,org.eclipse.papyrus.views.properties.model.edit@default:default,org.eclipse.papyrus.views.properties.model.editor@default:default,org.eclipse.papyrus.views.properties.model@default:default,org.eclipse.papyrus.views.properties@default:default,org.eclipse.papyrus.xwt.tests@default:default,org.eclipse.papyrus.xwt@default:default,org.eclipse.uml2.uml@default:default,org.eclipse.xtext.gmf.glue@default:default,skip_error_log@default:default"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
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:
- * <ul>
- * <li>click at 1/4 on the single StateInvariant (automatically created at the beginning; takes the whole width)
- * <li>click at 1/3 on the just created second StateInvariant (that takes 3/4 of the width)
- * <li>click at 1/2 on the just created second StateInvariant (that takes 1/2 of the width)
- * <li>this results in three regularly spaced occurrence specifications
- * <ul>
- *
- */
- protected void createThreeOccurrenceSpecificationsInDefaultFullLifeline() {
- createOccurrenceSpecificationInLastFullStateInvariantWithRatio(1, 1.0 / 4.0);
- createOccurrenceSpecificationInLastFullStateInvariantWithRatio(2, 1.0 / 3.0);
- createOccurrenceSpecificationInLastFullStateInvariantWithRatio(3, 1.0 / 2.0);
- }
-
- /**
- * Create three occurrence specifications in the default Lifeline:
- * <ul>
- * <li>click at 1/4 on the single StateInvariant (automatically created at the beginning; takes the whole width)
- * <li>click at 1/3 on the just created second StateInvariant (that takes 3/4 of the width)
- * <li>click at 1/2 on the just created second StateInvariant (that takes 1/2 of the width)
- * <li>this results in three regularly spaced occurrence specifications
- * <ul>
- *
- */
- protected void createThreeOccurrenceSpecificationsInDefaultCompactLifeline() {
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(1, 1.0 / 4.0);
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(2, 1.0 / 3.0);
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(3, 1.0 / 2.0);
- }
-
- /**
- * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
- *
- * @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
- * @param xPos
- * the position starting from the left of the StateInvariant
- */
- protected void createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
- // we need to wait for GMF to do its layout in order to have correct coordinates
- flushEventLoop();
- final FullStateInvariantEditPartCN lastStateInvariant = getAndAssertLastFullStateInvariant(expectedNumberOfStateInvariants);
- final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- assertTrue("position out of bounds", xPos < bounds.width);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + xPos, bounds.y));
- }
-
- /**
- * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
- *
- * @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
- * @param xPos
- * the position starting from the left of the StateInvariant
- */
- protected void createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
- // we need to wait for GMF to do its layout in order to have correct coordinates
- flushEventLoop();
- final CompactStateInvariantEditPartCN lastStateInvariant = getAndAssertLastCompactStateInvariant(expectedNumberOfStateInvariants);
- final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- assertTrue("position out of bounds", xPos < bounds.width);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + xPos, bounds.y));
- }
-
- /**
- * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default full Lifeline
- *
- * @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
- * @param ratio
- * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
- */
- protected void createOccurrenceSpecificationInLastFullStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
- assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
- // we need to wait for GMF to do its layout in order to have correct coordinates
- flushEventLoop();
- final FullStateInvariantEditPartCN lastStateInvariant = getAndAssertLastFullStateInvariant(expectedNumberOfStateInvariants);
- final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int)(bounds.width * ratio), bounds.y));
- }
-
- /**
- * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default compact Lifeline
- *
- * @param expectedNumberOfStateInvariants
- * the number of state invariants that is expected (for checking)
- * @param ratio
- * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
- */
- protected void createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
- assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
- // we need to wait for GMF to do its layout in order to have correct coordinates
- flushEventLoop();
- final CompactStateInvariantEditPartCN lastStateInvariant = getAndAssertLastCompactStateInvariant(expectedNumberOfStateInvariants);
- final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
- sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int)(bounds.width * ratio), bounds.y));
- }
-
- private FullStateInvariantEditPartCN getAndAssertLastFullStateInvariant(final int expectedNumberOfStateInvariants) {
- final List<FullStateInvariantEditPartCN> stateInvariants = findStateInvariantsInDefaultFullLifeline();
- assertEquals("Wrong number of StateInvariants", expectedNumberOfStateInvariants, stateInvariants.size());
- final FullStateInvariantEditPartCN lastStateInvariant = stateInvariants.get(expectedNumberOfStateInvariants - 1);
- return lastStateInvariant;
- }
-
- private CompactStateInvariantEditPartCN getAndAssertLastCompactStateInvariant(final int expectedNumberOfStateInvariants) {
- final List<CompactStateInvariantEditPartCN> stateInvariants = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("Wrong number of StateInvariants", expectedNumberOfStateInvariants, stateInvariants.size());
- final CompactStateInvariantEditPartCN lastStateInvariant = stateInvariants.get(expectedNumberOfStateInvariants - 1);
- return lastStateInvariant;
- }
-
- /** @return all OccurrenceSpecification EditParts found in the default Lifeline */
- @SuppressWarnings("unchecked")
- protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultFullLifeline() {
- return (List<OccurrenceSpecificationEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), OccurrenceSpecificationEditPartCN.VISUAL_ID);
- }
-
- /** @return all OccurrenceSpecification EditParts found in the default Lifeline */
- @SuppressWarnings("unchecked")
- protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultCompactLifeline() {
- return (List<OccurrenceSpecificationEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(), OccurrenceSpecificationEditPartCN.VISUAL_ID);
- }
-
- /** @return all StateInvariant EditParts found in the default Lifeline */
- @SuppressWarnings("unchecked")
- protected List<FullStateInvariantEditPartCN> findStateInvariantsInDefaultFullLifeline() {
- return (List<FullStateInvariantEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
- }
-
- /** @return all StateInvariant EditParts found in the default Lifeline */
- @SuppressWarnings("unchecked")
- protected List<CompactStateInvariantEditPartCN> findStateInvariantsInDefaultCompactLifeline() {
- return (List<CompactStateInvariantEditPartCN>)EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
- }
-
- /** @return all StateDefinition EditParts found in the default Lifeline */
- @SuppressWarnings("unchecked")
- protected List<StateDefinitionEditPart> findStateDefinitions() {
- return (List<StateDefinitionEditPart>)EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), StateDefinitionEditPart.VISUAL_ID);
- }
-
- /**
- * Check that the fragments in the default interaction are ordered following the given pattern.
- *
- * @param pattern
- * the pattern, where "o" means OccurrenceSpecification, and "-" means StateInvariant
- */
- protected void checkInteractionFragmentsWithPattern(final String expectedPattern) {
- final String fragmentsStringPattern = computeInteractionFragmentsStringPattern();
- assertEquals("The timeline does not follow the expected pattern", expectedPattern, fragmentsStringPattern);
- }
-
- protected String computeInteractionFragmentsStringPattern() {
- final StringBuilder pattern = new StringBuilder();
- final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
- final EList<InteractionFragment> fragments = interaction.getFragments();
- for(final InteractionFragment fragment : fragments) {
- if(fragment instanceof StateInvariant) {
- pattern.append("-");
- } else if(fragment instanceof DestructionOccurrenceSpecification) {
- pattern.append("x");
- } else if(fragment instanceof MessageOccurrenceSpecification) {
- pattern.append("m");
- } else if(fragment instanceof OccurrenceSpecification) {
- pattern.append("o");
- }
- }
- return pattern.toString();
- }
-
- protected InteractionCompartmentEditPartTN getDefaultInteractionCompartment() {
- return this.interactionCompartment;
- }
-
- protected InteractionEditPartTN getDefaultInteractionEditPart() {
- return this.interactionEditPart;
- }
-
- protected FullLifelineEditPartCN getDefaultFullLifelineEditPart() {
- return this.fullLifelineEditPart;
- }
-
- protected FullLifelineStateDefinitionCompartmentEditPartCN getDefaultStateDefinitionCompartment() {
- return this.stateDefinitionCompartment;
- }
-
- protected FullLifelineTimelineCompartmentEditPartCN getDefaultFullLifelineTimelineCompartment() {
- return this.fullLifelineTimelineCompartment;
- }
-
- protected CompactLifelineEditPartCN getDefaultCompactLifelineEditPart() {
- return this.compactLifelineEditPart;
- }
-
- protected CompactLifelineCompartmentEditPartCN getDefaultCompactLifelineTimelineCompartment() {
- return this.compactLifelineTimelineCompartment;
- }
-
- /**
- * Click in the middle of the given compact StateInvariant with the OccurrenceSpecification tool in order to create
- * an OccurrenceSpecification over it.
- *
- * @param compactStateInvariant
- * the StateInvariant on which to create an OccurrenceSpecification
- * @param bottom
- * whether to click at the bottom of the StateInvariant, instead of at the top
- */
- protected void createOccurrenceSpecificationOverCompactStateInvariant(final CompactStateInvariantEditPartCN compactStateInvariant, final boolean bottom) {
- final Rectangle bounds = getBounds(compactStateInvariant);
- final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + (bottom ? bounds.height - 2 : 2));
- compactStateInvariant.getFigure().getParent().translateToAbsolute(point);
- clickTool("createOccurrenceSpecificationCreationTool", point);
- }
-
- protected void checkFullTimelinePattern(final String expectedPattern) {
- final String timelineStringPattern = computeFullTimelineStringPattern();
- assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
- }
-
- protected String computeFullTimelineStringPattern() {
- flushEventLoop();
- final StringBuilder pattern = new StringBuilder();
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
- @SuppressWarnings("unchecked")
- final List<EditPart> children = timelineCompartment.getChildren();
- for(final EditPart editPart : children) {
- if(editPart instanceof FullStateInvariantEditPartCN) {
- outputFullStateInvariantPattern((FullStateInvariantEditPartCN)editPart, pattern);
- } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
- outputFullOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN)editPart, pattern);
- } else if(editPart instanceof FullStateInvariantVerticalLineEditPart) {
- pattern.append("VerticalLine;");
- } else {
- fail("unexpected element");
- }
- }
- return pattern.toString();
- }
-
- private static void outputFullStateInvariantPattern(final FullStateInvariantEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View)editPart.getModel();
- assertNotNull("The EditPart must have a View", view);
- final StateInvariant stateInvariant = (StateInvariant)view.getElement();
- assertNotNull("The View must have a semantic element", view);
- final Constraint constraint = stateInvariant.getInvariant();
- assertNotNull("The StateInvariant must have a Constraint", constraint);
- final ValueSpecification specification = constraint.getSpecification();
- assertNotNull("The Constraint must have a ValueSpecification", specification);
- assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
- final OpaqueExpression opaqueExpression = (OpaqueExpression)specification;
- assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
- assertEquals("The OpaqueExpression must have one Body", 1, opaqueExpression.getBodies().size());
- pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
- }
-
- private static void outputFullOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View)editPart.getModel();
- assertNotNull("The EditPart must have a View", view);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)view.getElement();
- assertNotNull("The View must have a semantic element", occurrenceSpecification);
- final String name = occurrenceSpecification.getName();
- pattern.append("OccurrenceSpecification(").append(name).append(");");
- }
-
- protected void checkCompactTimelinePattern(final String expectedPattern) {
- final String timelineStringPattern = computeCompactTimelineStringPattern();
- assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
- }
-
- protected String computeCompactTimelineStringPattern() {
- flushEventLoop();
- final StringBuilder pattern = new StringBuilder();
- final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
- @SuppressWarnings("unchecked")
- final List<EditPart> children = timelineCompartment.getChildren();
- for(final EditPart editPart : children) {
- if(editPart instanceof CompactStateInvariantEditPartCN) {
- outputCompactStateInvariantPattern((CompactStateInvariantEditPartCN)editPart, pattern);
- } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
- outputCompactOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN)editPart, pattern);
- } else {
- fail("unexpected element");
- }
- }
- return pattern.toString();
- }
-
- private static void outputCompactStateInvariantPattern(final CompactStateInvariantEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View)editPart.getModel();
- assertNotNull("The EditPart must have a View", view);
- final StateInvariant stateInvariant = (StateInvariant)view.getElement();
- assertNotNull("The View must have a semantic element", view);
- final Constraint constraint = stateInvariant.getInvariant();
- assertNotNull("The StateInvariant must have a Constraint", constraint);
- final ValueSpecification specification = constraint.getSpecification();
- assertNotNull("The Constraint must have a ValueSpecification", specification);
- assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
- final OpaqueExpression opaqueExpression = (OpaqueExpression)specification;
- assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
- if(opaqueExpression.getBodies().isEmpty()) {
- pattern.append("StateInvariant(unnamed);");
- } else {
- pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
- }
- }
-
- private static void outputCompactOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
- final View view = (View)editPart.getModel();
- assertNotNull("The EditPart must have a View", view);
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)view.getElement();
- assertNotNull("The View must have a semantic element", occurrenceSpecification);
- final String name = occurrenceSpecification.getName();
- pattern.append("OccurrenceSpecification(").append(name).append(");");
- }
-
- protected void checkSimpleFullTimelinePattern(final String expectedPattern) {
- final String timelineStringPattern = computeSimpleFullTimelineStringPattern();
- assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
- }
-
- protected String computeSimpleFullTimelineStringPattern() {
- flushEventLoop();
- final StringBuilder pattern = new StringBuilder();
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
- @SuppressWarnings("unchecked")
- final List<EditPart> children = timelineCompartment.getChildren();
- for(final EditPart editPart : children) {
- if(editPart instanceof FullStateInvariantEditPartCN) {
- pattern.append("-");
- } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
- pattern.append("o");
- } else if(editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
- pattern.append("m");
- } else if(editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
- pattern.append("x");
- } else if(editPart instanceof FullStateInvariantVerticalLineEditPart) {
- pattern.append("|");
- } else {
- fail("unexpected element");
- }
- }
- return pattern.toString();
- }
-
- /**
- * Check that the timeline contains the expected elements in the expected order.
- *
- * @param expectedPattern
- * a pattern where
- * <ul>
- * <li>"o" represents an OccurrenceSpecification
- * <li>"-" represents a StateInvariant
- * </ul>
- */
- protected void checkSimpleCompactTimelinePattern(final String expectedPattern) {
- final String timelineStringPattern = computeSimpleCompactTimelineStringPattern();
- assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
- }
-
- protected String computeSimpleCompactTimelineStringPattern() {
- flushEventLoop();
- final StringBuilder pattern = new StringBuilder();
- final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
- @SuppressWarnings("unchecked")
- final List<EditPart> children = timelineCompartment.getChildren();
- for(final EditPart editPart : children) {
- if(editPart instanceof CompactStateInvariantEditPartCN) {
- pattern.append("-");
- } else if(editPart instanceof OccurrenceSpecificationEditPartCN) {
- pattern.append("o");
- } else if(editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
- pattern.append("m");
- } else if(editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
- pattern.append("x");
- } else {
- fail("unexpected element");
- }
- }
- return pattern.toString();
- }
-
- /**
- * Test that the modifications can all be undone and redone, and that the dirty state is consistent throughout the
- * undo/redo operations.
- *
- * @param nElementsToUndo
- * the number of elements that should be undoable before reaching the non-dirty state
- */
- protected void testDirtyStateForFullUndoRedo(final int nElementsToUndo) {
- assertTrue("The editor should be dirty after all the modifications", this.diagramEditor.isDirty());
- for(int i = 0; i < nElementsToUndo; i++) {
- undoOnUIThread();
- // editor should be dirty for all states except the initial state
- if(i == nElementsToUndo - 1) {
- assertFalse("The editor should not be dirty after we undid all previous modifications", this.diagramEditor.isDirty());
- } else {
- assertTrue("The editor should be dirty until we undo all previous modifications", this.diagramEditor.isDirty());
- }
- }
- for(int i = 0; i < nElementsToUndo; i++) {
- redoOnUIThread();
- assertTrue("The editor should be dirty after we redo", this.diagramEditor.isDirty());
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
deleted file mode 100644
index 9363056e3f2..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
+++ /dev/null
@@ -1,29 +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 org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-//@formatter:off
-@RunWith(Suite.class)
-@SuiteClasses({ TestTimingDiagramInteraction.class, TestTimingDiagramFullLifeline.class, TestTimingDiagramCompactLifeline.class,
-
-TestTimingDiagramFullStateInvariant.class, TestTimingDiagramCompactStateInvariant.class,
-
-TestTimingDiagramFullOccurrenceSpecification.class, TestTimingDiagramCompactOccurrenceSpecification.class,
-
-TestTimingDiagramStateDefinition.class, TestTimingDiagramFullLifelineLayout.class,
-
-TestTimingDiagramMessages.class, })
-//@formatter:on
-public class AllCanonicalTests {
- // Junit 4 test case
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
deleted file mode 100644
index 769ebecf075..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
+++ /dev/null
@@ -1,95 +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.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineNameEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.NamedElement;
-import org.junit.Test;
-
-public class TestTimingDiagramCompactLifeline extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- }
-
- @Test
- public void testCreateLifeline() {
- createCompactLifelineInDefaultInteraction();
- }
-
- @Test
- public void testHideLifeline() {
- final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- testHide(lifelineEditPart);
- }
-
- @Test
- public void testDeleteLifeline() {
- final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- testDelete(lifelineEditPart);
- }
-
- @Test
- public void testDropLifeline() {
- // create a compact Lifeline and hide its View, so as to be able to drop it after that
- final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final Lifeline lifeline = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
- assertNotNull("The lifeline should not be null", lifeline);
- testHide(lifelineEditPart);
- testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
- }
-
- @Test
- public void testCellEditorLocator() {
- final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
- assertNotNull("The CompactLifelineNameEditPart was not found", compactLifelineNameEditPart);
- final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(compactLifelineNameEditPart);
- assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
- }
-
- @Test
- public void testEditLifelineName() {
- final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
- final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
- testSetNameWithDirectEditRequest(compactLifelineNameEditPart, namedElement);
- }
-
- @Test
- public void create3LifelinesTest() {
- final EditPart interactionCompartment = getDefaultInteractionCompartment();
- assertNotNull("The interaction compartment was not found", interactionCompartment);
- createView(UMLElementTypes.Lifeline_20, interactionCompartment);
- createView(UMLElementTypes.Lifeline_20, interactionCompartment);
- createView(UMLElementTypes.Lifeline_20, interactionCompartment);
- assertEquals("The interaction compartment should only contain the 3 lifelines", 3, interactionCompartment.getChildren().size());
- final List<? extends EditPart> editParts = EditPartUtils.findChildEditPartsWithId(interactionCompartment, CompactLifelineEditPartCN.VISUAL_ID);
- assertEquals("The interaction compartment should contain 3 lifelines", 3, editParts.size());
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
deleted file mode 100644
index dfaa97026de..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
+++ /dev/null
@@ -1,324 +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 java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-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.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.junit.Test;
-
-public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- createDefaultCompactLifeline();
- }
-
- @Test
- public void testCreateThreeOccurrenceSpecifications() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- final View interactionView = (View)getDefaultInteractionEditPart().getModel();
- final Interaction interaction = (Interaction)interactionView.getElement();
- assertTrue("The interaction should be in a Model", isInModel(interaction));
- // We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
- // OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
- // So, it should look like : "-o-o-o-" (with "-" for StateInvariant and "o" for OccurrenceSpecification)
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- }
-
- @Test
- public void testDeleteOccurrenceSpecification() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecifications = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
- final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
-
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)((View)middleOccurrence.getModel()).getElement();
- assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
-
- // destroy the middle OccurrenceSpecification
- final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- final Command command = middleOccurrence.getCommand(destroyElementRequest);
- checkCommand(command);
- execute(command);
- assertEquals("There should be one less OccurrenceSpecification", 2, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
- assertFalse("The OccurrenceSpecification should not be in the Model after deleting it", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
-
- // test undo
- undo();
- assertEquals("The OccurrenceSpecification should be back after the undo", 3, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
- assertTrue("The OccurrenceSpecification should be back in the Model after undoing the deletion", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
-
- // test redo
- redo();
- assertEquals("The OccurrenceSpecification should be removed after the redo", 2, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
- assertFalse("The OccurrenceSpecification should not be in the Model after redoing the deletion", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
- }
-
- @Test
- public void testCreateOccurrenceSpecificationWithDoubleClick() {
- final CompactStateInvariantEditPartCN stateInvariantEditPart = (CompactStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
- assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
- assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultCompactLifeline().size());
- final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
- assertNotNull("The StateInvariant must not be null", stateInvariant);
-
- final IFigure figure = stateInvariantEditPart.getFigure();
- final Rectangle bounds = new Rectangle(figure.getBounds());
- figure.getParent().translateToAbsolute(bounds);
-
- // click at the center of the StateInvariant line
- final int x = bounds.x + bounds.width / 2;
- final int y = bounds.y + bounds.height / 2;
-
- // send the open request (corresponding to a double-click)
- sendOpenSelectionRequest(stateInvariantEditPart, new Point(x, y));
-
- checkCreatedStateInvariants();
- checkCreatedOccurrenceSpecification();
-
- // test undo
- undoOnUIThread();
- assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultCompactLifeline().size());
- assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
-
- // test redo
- redoOnUIThread();
- assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultCompactLifeline().size());
- checkCreatedOccurrenceSpecification();
- }
-
- @Test
- public void testMoveOccurrenceSpecification() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- flushEventLoop();
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
- final OccurrenceSpecificationEditPartCN third = occurrenceSpecificationEditParts.get(2);
-
- final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
-
- final int minX = getBounds(first).x;
- final int maxX = getBounds(third).x;
-
- // shift to the left
- Rectangle boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-9, 0));
- Rectangle boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 9 pixels to the left", boundsBefore.x - 9, boundsAfter.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // shift to the right
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(13, 0));
- boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 13 pixels to the right", boundsBefore.x + 13, boundsAfter.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move past the previous OccurrenceSpecification (should be forbidden)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-(boundsBefore.x - minX + 10), 0));
- boundsAfter = getBounds(second);
- assertTrue("The Figure should be constrained, but still move", boundsAfter.x < boundsBefore.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move past the following OccurrenceSpecification (should be forbidden)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(maxX - boundsBefore.x + 10, 0));
- boundsAfter = getBounds(second);
- assertTrue("The Figure should be constrained, but still move", boundsAfter.x > boundsBefore.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move horizontally and vertically at the same time (should be constrained to an horizontal-only move)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-17, 123));
- boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 17 pixels to the left", boundsBefore.x - 17, boundsAfter.x);
- assertEquals("The Figure should not move vertically", boundsBefore.y, boundsAfter.y);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
- }
-
- /**
- * When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
- * the future positions of the elements being moved.
- */
- @Test
- public void testMoveAdjacentOccurrenceSpecifications() {
- // create two OccurrenceSpecifications close to each other
- createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(1, 100);
- createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(2, 10);
- flushEventLoop();
-
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 2, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
- final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
-
- // shift both to the left
- final Rectangle firstBefore = getBounds(first);
- final Rectangle secondBefore = getBounds(second);
- moveEditParts(Arrays.asList(first, second), timelineCompartment, new Point(-50, 0));
- final Rectangle firstAfter = getBounds(first);
- final Rectangle secondAfter = getBounds(second);
- assertEquals("The first Figure should have been moved 50 pixels to the left", firstBefore.x - 50, firstAfter.x);
- assertEquals("The second Figure should have been moved 50 pixels to the left", secondBefore.x - 50, secondAfter.x);
- }
-
- protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
- assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
- assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
- }
-
- @Test
- public void testFullUndoRedo() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- // 3 OccurrenceSpecifications + 1 Lifeline + 1 Interaction
- final int nElementsToUndo = 5;
- testDirtyStateForFullUndoRedo(nElementsToUndo);
- }
-
- @Test
- public void testCreateOccurrenceSpecificationOnCompactStateInvariant() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- flushEventLoop();
- checkSimpleCompactTimelinePattern("-o-o-o-");
-
- final List<CompactStateInvariantEditPartCN> stateInvariantsEditParts = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("Wrong number of StateInvariants", 4, stateInvariantsEditParts.size());
- final CompactStateInvariantEditPartCN s1 = stateInvariantsEditParts.get(0);
- final CompactStateInvariantEditPartCN s2 = stateInvariantsEditParts.get(1);
- final CompactStateInvariantEditPartCN s3 = stateInvariantsEditParts.get(2);
- final CompactStateInvariantEditPartCN s4 = stateInvariantsEditParts.get(3);
-
- createOccurrenceSpecificationOverCompactStateInvariant(s1, false);
- createOccurrenceSpecificationOverCompactStateInvariant(s2, true);
- createOccurrenceSpecificationOverCompactStateInvariant(s3, false);
- createOccurrenceSpecificationOverCompactStateInvariant(s4, true);
- flushEventLoop();
- checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
-
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 7, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN o1 = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN o2 = occurrenceSpecificationEditParts.get(1);
- final OccurrenceSpecificationEditPartCN o3 = occurrenceSpecificationEditParts.get(2);
- final OccurrenceSpecificationEditPartCN o4 = occurrenceSpecificationEditParts.get(3);
- final OccurrenceSpecificationEditPartCN o5 = occurrenceSpecificationEditParts.get(4);
- final OccurrenceSpecificationEditPartCN o6 = occurrenceSpecificationEditParts.get(5);
- final OccurrenceSpecificationEditPartCN o7 = occurrenceSpecificationEditParts.get(6);
-
- checkOccurrenceIsMiddleXTopYOfStateInvariant(o1, s1);
- checkOccurrenceIsRightXMiddleYOfStateInvariant(o2, s1);
- checkOccurrenceIsMiddleXBottomYOfStateInvariant(o3, s2);
- checkOccurrenceIsRightXMiddleYOfStateInvariant(o4, s2);
- checkOccurrenceIsMiddleXTopYOfStateInvariant(o5, s3);
- checkOccurrenceIsRightXMiddleYOfStateInvariant(o6, s3);
- checkOccurrenceIsMiddleXBottomYOfStateInvariant(o7, s4);
- }
-
- private static void checkOccurrenceIsMiddleXTopYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
- final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
- final Rectangle sBounds = getBounds(stateInvariantEditPart);
- assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - sBounds.y) <= 5);
- assertTrue("The occurrence should be located horizontally near the middle of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
- }
-
- private static void checkOccurrenceIsMiddleXBottomYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
- final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
- final Rectangle sBounds = getBounds(stateInvariantEditPart);
- assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - (sBounds.y + sBounds.height)) <= 5);
- assertTrue("The occurrence should be located horizontally near the middle of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
- }
-
- private static void checkOccurrenceIsRightXMiddleYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart, final CompactStateInvariantEditPartCN stateInvariantEditPart) {
- final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
- final Rectangle sBounds = getBounds(stateInvariantEditPart);
- assertTrue("The occurrence should be located vertically near the middle of the state invariant", Math.abs(oBounds.y - (sBounds.y + sBounds.height / 2)) <= 5);
- assertTrue("The occurrence should be located horizontally near the right of the state invariant", Math.abs(oBounds.x - (sBounds.x + sBounds.width)) <= 5);
- }
-
- protected void checkCreatedStateInvariants() {
- // check the StateInvariants
- final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("There must be two StateInvariants after creating an OccurrenceSpecification", 2, stateInvariantEditParts.size());
- checkStateInvariant(stateInvariantEditParts.get(0));
- checkStateInvariant(stateInvariantEditParts.get(1));
- }
-
- private void checkCreatedOccurrenceSpecification() {
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
- final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
- final View occurrenceSpecificationView = (View)occurrenceSpecificationEditPart.getModel();
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)occurrenceSpecificationView.getElement();
- assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
- assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
- assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
- final Lifeline lifeline = (Lifeline)((View)getDefaultCompactLifelineEditPart().getModel()).getElement();
- assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
- final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
- assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
- }
-
- private void checkStateInvariant(final CompactStateInvariantEditPartCN stateInvariantEditPartCN) {
- final View stateInvariantView = (View)stateInvariantEditPartCN.getModel();
- final StateInvariant stateInvariant = (StateInvariant)stateInvariantView.getElement();
- assertNotNull("The StateInvariant must not be null", stateInvariant);
- assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
- assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
- final Lifeline lifeline = (Lifeline)((View)getDefaultCompactLifelineEditPart().getModel()).getElement();
- assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
- final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
- assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
deleted file mode 100644
index 16930ef6438..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
+++ /dev/null
@@ -1,233 +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 java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantNameEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.junit.Test;
-
-public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- createDefaultCompactLifeline();
- }
-
- @Test
- public void testCutCompactStateInvariants() {
- final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("We should have one StateInvariant at the beginning of this test", 1, stateInvariantEditParts.size());
- checkCompactTimelinePattern("StateInvariant(unnamed);");
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(1, 1.0 / 4.0);
- checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(2, 1.0 / 3.0);
- createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(3, 1.0 / 2.0);
- checkSimpleCompactTimelinePattern("-o-o-o-");
- checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);" + "OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
- }
-
- @Test
- public void testEditCompactStateInvariantName() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- checkSimpleCompactTimelinePattern("-o-o-o-");
- final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("We should have four StateInvariants", 4, stateInvariantEditParts.size());
- int i = 1;
- for(final CompactStateInvariantEditPartCN stateInvariantEditPart : stateInvariantEditParts) {
- final CompactStateInvariantNameEditPart nameEditPart = (CompactStateInvariantNameEditPart)EditPartUtils.findFirstChildEditPartWithId(stateInvariantEditPart, CompactStateInvariantNameEditPart.VISUAL_ID);
- assertNotNull("The name edit part must not be null", nameEditPart);
- final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
- testSetNameWithDirectEditRequest(nameEditPart, stateInvariant, new INameProvider<StateInvariant>() {
-
- public String getName(final StateInvariant stateInvariant) {
- return StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
- }
- });
- setNameWithDirectEditRequest(nameEditPart, "state" + (i % 2 + 1));
- i++;
- }
- checkCompactTimelinePattern("StateInvariant(state2);OccurrenceSpecification(state2_1_To_state1_1);StateInvariant(state1);" + "OccurrenceSpecification(state1_1_To_state2_2);StateInvariant(state2);OccurrenceSpecification(state2_2_To_state1_2);StateInvariant(state1);");
- }
-
- @Test
- public void testDeleteStateInvariants() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(1);
- executeDestroyCommand(compactStateInvariantEditPart);
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
- undoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- redoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
- }
-
- @Test
- public void testDeleteStateInvariantsWithOccurrencesOnTop() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- final CompactStateInvariantEditPartCN s1 = findStateInvariantsInDefaultCompactLifeline().get(0);
- final CompactStateInvariantEditPartCN s2 = findStateInvariantsInDefaultCompactLifeline().get(1);
- final CompactStateInvariantEditPartCN s3 = findStateInvariantsInDefaultCompactLifeline().get(2);
- final CompactStateInvariantEditPartCN s4 = findStateInvariantsInDefaultCompactLifeline().get(3);
- createOccurrenceSpecificationOverCompactStateInvariant(s1, true);
- createOccurrenceSpecificationOverCompactStateInvariant(s2, false);
- createOccurrenceSpecificationOverCompactStateInvariant(s3, false);
- createOccurrenceSpecificationOverCompactStateInvariant(s4, true);
- flushEventLoop();
- checkInteractionFragmentsWithPattern("-oo-oo-oo-o");
- checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
-
- executeDestroyCommand(s1);
- checkInteractionFragmentsWithPattern("-oo-oo-o");
- checkSimpleCompactTimelinePattern("-oo-oo-o");
- undoOnUIThread();
- checkInteractionFragmentsWithPattern("-oo-oo-oo-o");
- checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
- redoOnUIThread();
- checkInteractionFragmentsWithPattern("-oo-oo-o");
- checkSimpleCompactTimelinePattern("-oo-oo-o");
-
- executeDestroyCommand(s4);
- checkInteractionFragmentsWithPattern("-oo-o");
- checkSimpleCompactTimelinePattern("-oo-o");
-
- executeDestroyCommand(s2);
- checkInteractionFragmentsWithPattern("-o");
- checkSimpleCompactTimelinePattern("-o");
- }
-
- @Test
- public void testHideStateInvariants() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(1);
- executeHideCommand(compactStateInvariantEditPart);
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
- undoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-o-");
- redoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleCompactTimelinePattern("-o-o-");
- }
-
- @Test
- public void testCannotDeleteLastStateInvariant() {
- checkInteractionFragmentsWithPattern("-");
- checkSimpleCompactTimelinePattern("-");
- final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(0);
- final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- final Command command = compactStateInvariantEditPart.getCommand(destroyElementRequest);
- assertFalse("We shouldn't be able to delete the last state invariant", command.canExecute());
- }
-
- @Test
- public void testCannotHideLastStateInvariant() {
- checkInteractionFragmentsWithPattern("-");
- checkSimpleCompactTimelinePattern("-");
- final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(0);
- final GroupRequest deleteViewRequest = new GroupRequest(org.eclipse.gef.RequestConstants.REQ_DELETE);
- deleteViewRequest.setEditParts(compactStateInvariantEditPart);
- final Command command = compactStateInvariantEditPart.getCommand(deleteViewRequest);
- assertFalse("We shouldn't be able to hide the last state invariant", command.canExecute());
- }
-
- @Test
- public void testResizeCompactStateInvariant() {
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- flushEventLoop();
- checkSimpleCompactTimelinePattern("-o-o-o-");
-
- final List<CompactStateInvariantEditPartCN> stateInvariantsEditParts = findStateInvariantsInDefaultCompactLifeline();
- assertEquals("Wrong number of StateInvariants", 4, stateInvariantsEditParts.size());
- final CompactStateInvariantEditPartCN s2 = stateInvariantsEditParts.get(1);
- final CompactStateInvariantEditPartCN s3 = stateInvariantsEditParts.get(2);
-
- createOccurrenceSpecificationOverCompactStateInvariant(s2, false);
- createOccurrenceSpecificationOverCompactStateInvariant(s3, true);
- flushEventLoop();
- checkSimpleCompactTimelinePattern("-o-oo-oo-");
-
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 5, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN o1 = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN o2 = occurrenceSpecificationEditParts.get(1);
- final OccurrenceSpecificationEditPartCN o3 = occurrenceSpecificationEditParts.get(2);
- final OccurrenceSpecificationEditPartCN o4 = occurrenceSpecificationEditParts.get(3);
- final OccurrenceSpecificationEditPartCN o5 = occurrenceSpecificationEditParts.get(4);
-
- final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
-
- // test shrink
- testResizeCompactStateInvariant(s2, -9, o1, o2, o3, o4, o5, timelineCompartment);
- // test grow
- testResizeCompactStateInvariant(s2, 42, o1, o2, o3, o4, o5, timelineCompartment);
- }
-
- private void testResizeCompactStateInvariant(final CompactStateInvariantEditPartCN s2, final int widthDelta, final OccurrenceSpecificationEditPartCN o1, final OccurrenceSpecificationEditPartCN o2, final OccurrenceSpecificationEditPartCN o3, final OccurrenceSpecificationEditPartCN o4, final OccurrenceSpecificationEditPartCN o5, final CompactLifelineCompartmentEditPartCN timelineCompartment) {
- final Rectangle o1Before = getBounds(o1);
- final Rectangle o2Before = getBounds(o2);
- final Rectangle o3Before = getBounds(o3);
- final Rectangle o4Before = getBounds(o4);
- final Rectangle o5Before = getBounds(o5);
- final Rectangle boundsBefore = getBounds(s2);
- resizeEditPart(s2, timelineCompartment, new Dimension(widthDelta, 0), PositionConstants.EAST);
- final Rectangle o1After = getBounds(o1);
- final Rectangle o2After = getBounds(o2);
- final Rectangle o3After = getBounds(o3);
- final Rectangle o4After = getBounds(o4);
- final Rectangle o5After = getBounds(o5);
- final Rectangle boundsAfter = getBounds(s2);
- assertEquals("The Figure should have been resized horizontally", boundsBefore.width + widthDelta, boundsAfter.width);
- assertEquals("The OccurrenceSpecification before it shouldn't have moved", o1Before.x, o1After.x);
- assertEquals("The OccurrenceSpecification on top of it shouldn't have moved", o2Before.x, o2After.x);
- assertEquals("The OccurrenceSpecifications after it should have moved", o3Before.x + widthDelta, o3After.x);
- assertEquals("The OccurrenceSpecifications on the bottom of another state shouldn't have moved", o4Before.x, o4After.x);
- assertEquals("The OccurrenceSpecifications after it should have moved", o5Before.x + widthDelta, o5After.x);
- testUndoRedoChangeBoundsEditPart(s2, boundsBefore);
- }
-
- protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
- assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
- assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
deleted file mode 100644
index 73ff53ce99b..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
+++ /dev/null
@@ -1,95 +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.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineNameEditPart;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.NamedElement;
-import org.junit.Test;
-
-public class TestTimingDiagramFullLifeline extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- }
-
- @Test
- public void testCreateLifeline() {
- createFullLifelineInDefaultInteraction();
- }
-
- @Test
- public void testHideLifeline() {
- final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- testHide(lifelineEditPart);
- }
-
- @Test
- public void testDeleteLifeline() {
- final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- testDelete(lifelineEditPart);
- }
-
- @Test
- public void testDropLifeline() {
- // create a Lifeline and hide its View, so as to be able to drop it after that
- final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final Lifeline lifeline = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
- assertNotNull("The lifeline should not be null", lifeline);
- testHide(lifelineEditPart);
- testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
- }
-
- @Test
- public void testCellEditorLocator() {
- final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final FullLifelineNameEditPart fullLifelineNameEditPart = (FullLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineNameEditPart.VISUAL_ID);
- assertNotNull("The FullLifelineNameEditPart was not found", fullLifelineNameEditPart);
- final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(fullLifelineNameEditPart);
- assertTrue("The cell editor locator must be the one specific to the vertical label", textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
- }
-
- @Test
- public void testEditLifelineName() {
- final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
- final FullLifelineNameEditPart lifelineNameEditPart = (FullLifelineNameEditPart)EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart, FullLifelineNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Lifeline)((View)lifelineEditPart.getModel()).getElement();
- testSetNameWithDirectEditRequest(lifelineNameEditPart, namedElement);
- }
-
- @Test
- public void create3LifelinesTest() {
- final EditPart interactionCompartment = getDefaultInteractionCompartment();
- assertNotNull("The interaction compartment was not found", interactionCompartment);
- createView(UMLElementTypes.Lifeline_19, interactionCompartment);
- createView(UMLElementTypes.Lifeline_19, interactionCompartment);
- createView(UMLElementTypes.Lifeline_19, interactionCompartment);
- assertEquals("The interaction compartment should only contain the 3 lifelines", 3, interactionCompartment.getChildren().size());
- final List<? extends EditPart> editParts = EditPartUtils.findChildEditPartsWithId(interactionCompartment, FullLifelineEditPartCN.VISUAL_ID);
- assertEquals("The interaction compartment should contain 3 lifelines", 3, editParts.size());
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
deleted file mode 100644
index d6656d9412e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
+++ /dev/null
@@ -1,46 +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 org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.junit.Test;
-
-public class TestTimingDiagramFullLifelineLayout extends AbstractTimingDiagramTestCase {
-
- /**
- * This tests the layout of StateDefinitions, with some error margins in order to accommodate possible future
- * modifications of the layout.
- */
- @Test
- public void testStateDefinitionsLayout() {
- final Point interactionLocation = new Point(12, 17);
- final Dimension interactionSize = new Dimension(867, 729);
- final InteractionEditPartTN interactionEditPart = createInteraction(interactionLocation, interactionSize);
- assertBounds(interactionEditPart, interactionLocation, interactionSize, 0, 0, 0, 0);
- final FullLifelineEditPartCN lifelineEditPart = createFullLifeline(interactionEditPart);
- assertBounds(lifelineEditPart, new Rectangle(23, 45, 845, 694), 50, 50, 100, 100);
- // a single StateDefinition: should be centered
- final StateDefinitionEditPart stateDefinition1 = createStateDefinition(lifelineEditPart);
- assertBounds(stateDefinition1, new Rectangle(84, 382, 40, 20), 50, 50, 30, 10);
- // two StateDefinitions: should be regularly spaced
- final StateDefinitionEditPart stateDefinition2 = createStateDefinition(lifelineEditPart);
- assertBounds(stateDefinition1, new Rectangle(84, 266, 40, 20), 50, 50, 30, 10);
- assertBounds(stateDefinition2, new Rectangle(84, 498, 40, 20), 50, 50, 30, 10);
- // three StateDefinitions: should be regularly spaced
- final StateDefinitionEditPart stateDefinition3 = createStateDefinition(lifelineEditPart);
- assertBounds(stateDefinition1, new Rectangle(84, 151, 40, 20), 50, 50, 30, 10);
- assertBounds(stateDefinition2, new Rectangle(84, 382, 40, 20), 50, 50, 30, 10);
- assertBounds(stateDefinition3, new Rectangle(84, 613, 40, 20), 50, 50, 30, 10);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
deleted file mode 100644
index d2ac36557de..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
+++ /dev/null
@@ -1,288 +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 java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-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.OccurrenceSpecificationEditPartCN;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.junit.Test;
-
-public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- createDefaultFullLifeline();
- createThreeStateDefinitionsInDefaultFullLifeline();
- }
-
- @Test
- public void testModelWithThreeOccurrenceSpecifications() {
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- final View interactionView = (View)getDefaultInteractionEditPart().getModel();
- final Interaction interaction = (Interaction)interactionView.getElement();
- assertTrue("The interaction should be in a Model", isInModel(interaction));
- // We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
- // OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
- // So, it should look like : "-o-o-o-" (with "-" for StateInvariant and "O" for OccurrenceSpecification)
- checkInteractionFragmentsWithPattern("-o-o-o-");
- }
-
- @Test
- public void testDeleteOccurrenceSpecification() {
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecifications = findOccurrenceSpecificationsInDefaultFullLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
- final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
-
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)((View)middleOccurrence.getModel()).getElement();
- assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-o-");
-
- // destroy the middle OccurrenceSpecification
- final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- final Command command = middleOccurrence.getCommand(destroyElementRequest);
- checkCommand(command);
- execute(command);
- assertEquals("There should be one less OccurrenceSpecification", 2, findOccurrenceSpecificationsInDefaultFullLifeline().size());
- assertFalse("The OccurrenceSpecification should not be in the Model after deleting it", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-");
-
- // test undo
- undo();
- assertEquals("The OccurrenceSpecification should be back after the undo", 3, findOccurrenceSpecificationsInDefaultFullLifeline().size());
- assertTrue("The OccurrenceSpecification should be back in the Model after undoing the deletion", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-o-");
-
- // test redo
- redo();
- assertEquals("The OccurrenceSpecification should be removed after the redo", 2, findOccurrenceSpecificationsInDefaultFullLifeline().size());
- assertFalse("The OccurrenceSpecification should not be in the Model after redoing the deletion", isInModel(occurrenceSpecification));
- checkInteractionFragmentsWithPattern("-o-o-");
- }
-
- @Test
- public void testCreateOccurrenceSpecificationWithDoubleClick() {
- final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
- assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
- assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultFullLifeline().size());
- final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
- assertNotNull("The StateInvariant must not be null", stateInvariant);
-
- final IFigure figure = stateInvariantEditPart.getFigure();
- final Rectangle bounds = new Rectangle(figure.getBounds());
- figure.getParent().translateToAbsolute(bounds);
-
- // click at the center of the StateInvariant line
- final int x = bounds.x + bounds.width / 2;
- final int y = bounds.y + bounds.height / 2;
-
- // send the open request (corresponding to a double-click)
- sendOpenSelectionRequest(stateInvariantEditPart, new Point(x, y));
-
- checkCreatedStateInvariants();
- checkCreatedOccurrenceSpecification();
-
- // test undo
- undoOnUIThread();
- assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultFullLifeline().size());
- assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultFullLifeline().size());
-
- // test redo
- redoOnUIThread();
- assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultFullLifeline().size());
- checkCreatedOccurrenceSpecification();
- }
-
- @Test
- public void testCreateOccurrenceSpecificationWithPaletteTool() {
- // let GMF do its layout (in order for the Figure coordinates to be set)
- flushEventLoop();
- final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN)EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
- assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
-
- // use the OccurrenceSpecification creation tool to create a new OccurrenceSpecification
- clickTool("createOccurrenceSpecificationCreationTool", stateInvariantEditPart);
-
- checkCreatedStateInvariants();
- checkCreatedOccurrenceSpecification();
-
- // test undo
- undoOnUIThread();
- assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultFullLifeline().size());
- assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultFullLifeline().size());
-
- // test redo
- redoOnUIThread();
- assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultFullLifeline().size());
- checkCreatedOccurrenceSpecification();
- }
-
- @Test
- public void testMoveOccurrenceSpecification() {
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- flushEventLoop();
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
- final OccurrenceSpecificationEditPartCN third = occurrenceSpecificationEditParts.get(2);
-
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
-
- final int minX = getBounds(first).x;
- final int maxX = getBounds(third).x;
-
- // shift to the left
- Rectangle boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-9, 0));
- Rectangle boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 9 pixels to the left", boundsBefore.x - 9, boundsAfter.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // shift to the right
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(13, 0));
- boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 13 pixels to the right", boundsBefore.x + 13, boundsAfter.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move past the previous OccurrenceSpecification (should be forbidden)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-(boundsBefore.x - minX + 10), 0));
- boundsAfter = getBounds(second);
- assertTrue("The Figure should be constrained, but still move", boundsAfter.x < boundsBefore.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move past the following OccurrenceSpecification (should be forbidden)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(maxX - boundsBefore.x + 10, 0));
- boundsAfter = getBounds(second);
- assertTrue("The Figure should be constrained, but still move", boundsAfter.x > boundsBefore.x);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
-
- // try to move horizontally and vertically at the same time (should be constrained to an horizontal-only move)
- boundsBefore = getBounds(second);
- moveEditPart(second, timelineCompartment, new Point(-17, 123));
- boundsAfter = getBounds(second);
- assertEquals("The Figure should have been moved 17 pixels to the left", boundsBefore.x - 17, boundsAfter.x);
- assertEquals("The Figure should not move vertically", boundsBefore.y, boundsAfter.y);
- checkBounds(boundsAfter, minX, maxX);
- testUndoRedoChangeBoundsEditPart(second, boundsBefore);
- }
-
- /**
- * When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
- * the future positions of the elements being moved.
- */
- @Test
- public void testMoveAdjacentOccurrenceSpecifications() {
- // create two OccurrenceSpecifications close to each other
- createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(1, 100);
- createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(2, 10);
- flushEventLoop();
-
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
- assertEquals("Wrong number of OccurrenceSpecifications", 2, occurrenceSpecificationEditParts.size());
-
- final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
- final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
- final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
-
- // shift both to the left
- final Rectangle firstBefore = getBounds(first);
- final Rectangle secondBefore = getBounds(second);
- moveEditParts(Arrays.asList(first, second), timelineCompartment, new Point(-50, 0));
- final Rectangle firstAfter = getBounds(first);
- final Rectangle secondAfter = getBounds(second);
- assertEquals("The first Figure should have been moved 50 pixels to the left", firstBefore.x - 50, firstAfter.x);
- assertEquals("The second Figure should have been moved 50 pixels to the left", secondBefore.x - 50, secondAfter.x);
- }
-
- protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
- assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
- assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
- }
-
- @Test
- public void testMoveVerticalLine() {
- // TODO: test that moving a vertical line moves the preceding occurrence specification
- }
-
- @Test
- public void testFullUndoRedo() {
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- // 3 OccurrenceSpecifications + 3 StateDefinitions + 1 Lifeline + 1 Interaction
- final int nElementsToUndo = 8;
- testDirtyStateForFullUndoRedo(nElementsToUndo);
- }
-
- protected void checkCreatedStateInvariants() {
- // check the StateInvariants
- final List<FullStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultFullLifeline();
- assertEquals("There must be two StateInvariants after creating an OccurrenceSpecification", 2, stateInvariantEditParts.size());
- checkStateInvariant(stateInvariantEditParts.get(0));
- checkStateInvariant(stateInvariantEditParts.get(1));
- }
-
- private void checkCreatedOccurrenceSpecification() {
- final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
- assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
- final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
- final View occurrenceSpecificationView = (View)occurrenceSpecificationEditPart.getModel();
- final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification)occurrenceSpecificationView.getElement();
- assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
- assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
- assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
- final Lifeline lifeline = (Lifeline)((View)getDefaultFullLifelineEditPart().getModel()).getElement();
- assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
- final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
- assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
- }
-
- private void checkStateInvariant(final FullStateInvariantEditPartCN fullStateInvariantEditPartCN) {
- final View stateInvariantView = (View)fullStateInvariantEditPartCN.getModel();
- final StateInvariant stateInvariant = (StateInvariant)stateInvariantView.getElement();
- assertNotNull("The StateInvariant must not be null", stateInvariant);
- assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
- assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
- final Lifeline lifeline = (Lifeline)((View)getDefaultFullLifelineEditPart().getModel()).getElement();
- assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
- final Interaction interaction = (Interaction)((View)getDefaultInteractionEditPart().getModel()).getElement();
- assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
deleted file mode 100644
index 8b53a16a4b0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
+++ /dev/null
@@ -1,103 +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 java.util.List;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
-import org.junit.Test;
-
-public class TestTimingDiagramFullStateInvariant extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction(new Point(0, 0), new Dimension(800, 600));
- createDefaultFullLifeline();
- createThreeStateDefinitionsInDefaultFullLifeline();
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- }
-
- @Test
- public void testMoveStateInvariants() {
- final List<FullStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultFullLifeline();
- assertEquals("We should have 4 StateInvariants at the beginning of this test", 4, stateInvariantEditParts.size());
- final List<StateDefinitionEditPart> stateDefinitionEditParts = findStateDefinitions();
- assertEquals("We should have 3 StateDefinitions at the beginning of this test", 3, stateDefinitionEditParts.size());
-
- // computeTimelineStringPattern();
- checkFullTimelinePattern("StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_3_To_State 1_4);VerticalLine;" + "StateInvariant(State 1);");
-
- final Rectangle stateDefBounds1 = getAbsoluteBounds(stateDefinitionEditParts.get(0));
- final Rectangle stateDefBounds2 = getAbsoluteBounds(stateDefinitionEditParts.get(1));
- // final Rectangle stateDefBounds3 = getAbsoluteBounds(stateDefinitionEditParts.get(2));
- final int distanceBetweenStates = stateDefBounds2.y - stateDefBounds1.y;
-
- // final Rectangle stateInvBounds1 = getAbsoluteBounds(stateInvariantEditParts.get(0));
- // final Rectangle stateInvBounds2 = getAbsoluteBounds(stateInvariantEditParts.get(1));
- // final Rectangle stateInvBounds3 = getAbsoluteBounds(stateInvariantEditParts.get(2));
- // final Rectangle stateInvBounds4 = getAbsoluteBounds(stateInvariantEditParts.get(3));
-
- // TODO: check state invariant in front of state definitions
-
- moveEditPart(stateInvariantEditParts.get(0), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;StateInvariant(State 1);");
- moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;StateInvariant(State 1);");
- moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;StateInvariant(State 2);");
- moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 3_2);VerticalLine;StateInvariant(State 3);");
- moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 3_2);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_2_To_State 3_3);VerticalLine;StateInvariant(State 3);");
- moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, -distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;" + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 2_2);VerticalLine;" + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_2);VerticalLine;StateInvariant(State 3);");
- moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, -2 * distanceBetweenStates));
- checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;" + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;" + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_1);VerticalLine;StateInvariant(State 3);");
- }
-
- @Test
- public void testDeleteStateInvariants() {
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-o|-");
- final FullStateInvariantEditPartCN stateInvariantEditPart = findStateInvariantsInDefaultFullLifeline().get(1);
- executeDestroyCommand(stateInvariantEditPart);
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-");
- undoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-o|-");
- redoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-");
- }
-
- @Test
- public void testHideStateInvariants() {
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-o|-");
- final FullStateInvariantEditPartCN stateInvariantEditPart = findStateInvariantsInDefaultFullLifeline().get(1);
- executeHideCommand(stateInvariantEditPart);
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-");
- undoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-o|-");
- redoOnUIThread();
- checkInteractionFragmentsWithPattern("-o-o-o-");
- checkSimpleFullTimelinePattern("-o|-o|-");
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
deleted file mode 100644
index efe338e0145..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
+++ /dev/null
@@ -1,78 +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.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionNameEditPart;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.NamedElement;
-import org.junit.Test;
-
-public class TestTimingDiagramInteraction extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- }
-
- @Test
- public void testCreateInteraction() {
- createInteraction();
- }
-
- @Test
- public void testHideInteraction() {
- final InteractionEditPartTN interaction = createInteraction();
- testHide(interaction);
- }
-
- @Test
- public void testDeleteInteraction() {
- final InteractionEditPartTN interaction = createInteraction();
- testDelete(interaction);
- }
-
- @Test
- public void testDropInteraction() {
- // create an Interaction and hide its View, so as to be able to drop it after that
- final InteractionEditPartTN interactionEditPart = createInteraction();
- final Interaction interaction = (Interaction)((View)interactionEditPart.getModel()).getElement();
- assertNotNull("The interaction should not be null", interaction);
- hide(interactionEditPart);
-
- testDrop(getDiagramEditPart(), getDiagramEditPart(), interaction);
- }
-
- @Test
- public void testCreateThreeInteractions() {
- final InteractionEditPartTN interaction1 = createInteraction();
- final InteractionEditPartTN interaction2 = createInteraction();
- final InteractionEditPartTN interaction3 = createInteraction();
- assertEquals("The diagram should only contain the 3 interactions", 3, getDiagramEditPart().getChildren().size());
- assertTrue("The first interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction1));
- assertTrue("The second interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction2));
- assertTrue("The third interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction3));
- }
-
- @Test
- public void testEditInteractionName() {
- final InteractionEditPartTN interactionEditPart = createInteraction();
- final InteractionNameEditPart interactionNameEditPart = (InteractionNameEditPart)EditPartUtils.findFirstChildEditPartWithId(interactionEditPart, InteractionNameEditPart.VISUAL_ID);
- final NamedElement namedElement = (Interaction)((View)interactionEditPart.getModel()).getElement();
- testSetNameWithDirectEditRequest(interactionNameEditPart, namedElement);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
deleted file mode 100644
index 02433f1f94c..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
+++ /dev/null
@@ -1,50 +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 org.eclipse.swt.widgets.Text;
-import org.junit.Test;
-
-public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- createDefaultFullLifeline();
- createDefaultCompactLifeline();
- createStateDefinitionInDefaultFullLifeline();
- createThreeOccurrenceSpecificationsInDefaultFullLifeline();
- createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
- }
-
- @Test
- public void testCreateSyncMessage() {
- clickTwiceWithTool("createMessageSyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
- final Text text = findVisibleTextWidgetOnDiagram();
- setText(text, "abc");
-
- checkSimpleFullTimelinePattern("-m|-o|-o|-");
- checkSimpleCompactTimelinePattern("-o-m-o-");
- checkInteractionFragmentsWithPattern("--m-o-o-o-m-o-");
-
- // TODO: check covered fragments on lifelines
- // TODO: check sync Message instance
- }
-
- @Test
- public void testCreateAsyncMessage() {
- clickTwiceWithTool("createMessageAsyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0), findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
- final Text text = findVisibleTextWidgetOnDiagram();
- setText(text, "def");
- // TODO: check async Message instance
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
deleted file mode 100644
index 16370e88091..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
+++ /dev/null
@@ -1,223 +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.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Map.Entry;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.util.EMap;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
-import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
-import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionLabelEditPart;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.StateInvariant;
-import org.junit.Test;
-
-public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestCase {
-
- @Override
- public void setUp() throws Exception {
- // create the project, model and diagram
- super.setUp();
- createDefaultInteraction();
- createDefaultFullLifeline();
- }
-
- @Test
- public void testCreateStateDefinition() {
- final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
- final EditPart stateInvariantEditPart = EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
- assertNotNull("A StateInvariant must be created with the first StateDefinition", stateInvariantEditPart);
- final StateInvariant stateInvariant = (StateInvariant)((View)stateInvariantEditPart.getModel()).getElement();
- assertNotNull("The StateInvariant must not be null", stateInvariant);
- final String stateInvariantId = StateInvariantUtils.getStateInvariantId(stateInvariant);
- assertNotNull("The StateInvariant id must not be null", stateInvariantId);
- final String stateDefinitionViewID = StateDefinitionUtils.getStateDefinitionViewID((View)stateDefinition.getModel());
- assertEquals("The ids of the StateDefinition and the StateInvariant must be equal", stateDefinitionViewID, stateInvariantId);
-
- }
-
- @Test
- public void testCreateMultipleStateDefinitions() {
- createStateDefinitionInDefaultFullLifeline();
- expectNStateDefinitions(1);
- createStateDefinitionInDefaultFullLifeline();
- expectNStateDefinitions(2);
- undoOnUIThread();
- expectNStateDefinitions(1);
- redoOnUIThread();
- expectNStateDefinitions(2);
- createStateDefinitionInDefaultFullLifeline();
- expectNStateDefinitions(3);
- undoOnUIThread();
- expectNStateDefinitions(2);
- redoOnUIThread();
- expectNStateDefinitions(3);
- }
-
- private void expectNStateDefinitions(final int numberOfExpectedStateDefinitions) {
- assertEquals("There must be " + numberOfExpectedStateDefinitions + " StateDefinitionEditPart", numberOfExpectedStateDefinitions, findStateDefinitions().size());
- }
-
- /**
- * Creates a new StateDefinition by clicking using the StateDefinition palette tool (this is important to test
- * because we customized this tool).
- */
- @Test
- public void testCreateStateDefinitionWithPaletteTool() {
- final FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment = getDefaultStateDefinitionCompartment();
- // let GMF do its layout
- flushEventLoop();
- final int nChildrenBefore = stateDefinitionCompartment.getChildren().size();
- final Rectangle bounds = stateDefinitionCompartment.getFigure().getBounds();
- stateDefinitionCompartment.getFigure().getParent().translateToAbsolute(bounds);
- // click center at the top of the compartment
- final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + 1);
- // use the StateDefinition creation tool to create a new StateDefinition
- clickTool("createStateDefinitionCreationTool", point);
- final Text text = findVisibleTextWidgetOnDiagram();
- assertEquals("The state definition compartment should contain one more child", nChildrenBefore + 1, stateDefinitionCompartment.getChildren().size());
- assertNotNull("A Text cell editor should appear after creating a StateDefinition", text);
- final String newName = "state " + System.currentTimeMillis();
- setText(text, newName);
- checkStateDefinition(newName);
- }
-
- /**
- * Check that there is a StateDefinition with the given name.
- *
- * @param expectedName
- * the name of a StateDefinition that should exist.
- */
- protected void checkStateDefinition(final String expectedName) {
- final View lifelineView = (View)getDefaultFullLifelineEditPart().getModel();
- final Lifeline lifeline = (Lifeline)lifelineView.getElement();
- final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
- assertNotNull("The lifeline should have an EAnnotation for the state definitions", stateDefinitionsEAnnotation);
-
- // find the entry corresponding to the new StateDefinition
- Entry<String, String> newEntry = null;
- final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
- for(final Entry<String, String> entry : details) {
- if(expectedName.equals(entry.getValue())) {
- newEntry = entry;
- break;
- }
- }
- assertNotNull("The Lifeline's EAnnotation should contain an entry for the StateDefinition", newEntry);
- @SuppressWarnings("null")
- final String id = newEntry.getKey();
- final View stateDefinitionView = StateDefinitionUtils.getStateDefinitionViewWithId(id, lifelineView);
- final String stateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
- assertEquals("getStateDefinitionName should return the name of the StateDefinition", expectedName, stateDefinitionName);
- }
-
- /** Check that no StateDefinition exists with the given name. */
- protected void checkNoStateDefinition(final String unexpectedName) {
- final View lifelineView = (View)getDefaultFullLifelineEditPart().getModel();
- final Lifeline lifeline = (Lifeline)lifelineView.getElement();
- final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
- if(stateDefinitionsEAnnotation == null) {
- return;
- }
- // find the entry corresponding to the new StateDefinition
- final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
- for(final Entry<String, String> entry : details) {
- if(unexpectedName.equals(entry.getValue())) {
- fail("A StateDefinition with the given name exists");
- }
- }
- }
-
- @Test
- public void testDeleteStateDefinition() {
- final EditPart stateDefinition1 = createStateDefinitionInDefaultFullLifeline();
- final EditPart stateDefinition2 = createStateDefinitionInDefaultFullLifeline();
- final EditPart stateDefinition3 = createStateDefinitionInDefaultFullLifeline();
-
- final GroupRequest deleteRequest1 = new GroupRequest(RequestConstants.REQ_DELETE);
- deleteRequest1.setEditParts(stateDefinition1);
- final Command command1 = stateDefinition1.getCommand(deleteRequest1);
- assertTrue("The first StateDefinition should not be deletable since a StateInvariant uses it", command1 instanceof UnexecutableCommand);
-
- testDeleteStateDefinition(stateDefinition2, "second state definition for testDeleteStateDefinition");
- testDeleteStateDefinition(stateDefinition3, "third state definition for testDeleteStateDefinition");
- }
-
- protected void testDeleteStateDefinition(final EditPart stateDefinition, final String name) {
- // set a name before deleting so that we can then check whether it was really deleted/re-created
- setNameWithDirectEditRequest(getStateDefinitionLabelEditPart(stateDefinition), name);
- checkStateDefinition(name);
-
- final FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment = getDefaultStateDefinitionCompartment();
- final int sizeBefore = stateDefinitionCompartment.getChildren().size();
-
- // this is actually a "hide" instead of a "delete", since StateDefinition has no UML semantic element
- final GroupRequest deleteRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- deleteRequest.setEditParts(stateDefinition);
- final Command command = stateDefinition.getCommand(deleteRequest);
- checkCommand(command);
- executeOnUIThread(command);
- assertEquals("The StateDefinition compartment should now contain one less child", sizeBefore - 1, stateDefinitionCompartment.getChildren().size());
- checkNoStateDefinition(name);
- undoOnUIThread();
- assertEquals("The child should be back after the undo", sizeBefore, stateDefinitionCompartment.getChildren().size());
- checkStateDefinition(name);
- redoOnUIThread();
- assertEquals("The child should be removed after the redo", sizeBefore - 1, stateDefinitionCompartment.getChildren().size());
- checkNoStateDefinition(name);
- }
-
- @Test
- public void testEditStateDefinitionName() {
- final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
- final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = getStateDefinitionLabelEditPart(stateDefinition);
- // set first name
- final String name1 = "test name 1 " + System.currentTimeMillis();
- setNameWithDirectEditRequest(stateDefinitionLabelEditPart, name1);
- checkStateDefinition(name1);
- // set second name
- final String name2 = "test name 2 " + System.currentTimeMillis();
- setNameWithDirectEditRequest(stateDefinitionLabelEditPart, name2);
- checkStateDefinition(name2);
- checkNoStateDefinition(name1);
- // test undo
- undo();
- checkStateDefinition(name1);
- checkNoStateDefinition(name2);
- // test redo
- redo();
- checkStateDefinition(name2);
- checkNoStateDefinition(name1);
-
- // TODO: check fragment names are updated when changing the state definition name
- }
-
- private static StateDefinitionLabelEditPart getStateDefinitionLabelEditPart(final EditPart stateDefinitionEditPart) {
- final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = (StateDefinitionLabelEditPart)EditPartUtils.findFirstChildEditPartWithId(stateDefinitionEditPart, StateDefinitionLabelEditPart.VISUAL_ID);
- return stateDefinitionLabelEditPart;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
deleted file mode 100644
index ec1d118edf6..00000000000
--- a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 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
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.timing.tests.generic;
-
-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.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.operations.IOperationHistoryListener;
-import org.eclipse.core.commands.operations.OperationHistoryEvent;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.ICreationCommand;
-import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
-import org.eclipse.papyrus.uml.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.intro.IIntroPart;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.NamedElement;
-import org.junit.After;
-import org.junit.Before;
-
-// DiResourceSet is deprecated but we need it for CreateUMLModelCommand
-@SuppressWarnings({ "deprecation" })
-public abstract class AbstractPapyrusTestCase {
-
- protected PapyrusMultiDiagramEditor papyrusEditor;
-
- protected DiResourceSet diResourceSet;
-
- protected IProject project;
-
- protected IFile file;
-
- protected IWorkbenchPage page;
-
- protected UmlGmfDiagramEditor diagramEditor = null;
-
- protected DiagramEditPart diagramEditPart;
-
- protected boolean operationFailed = false;
-
- @Before
- public void setUp() throws Exception {
- Runnable closeIntroRunnable = new Runnable() {
-
- public void run() {
- IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
- PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
- }
- };
- PlatformUI.getWorkbench().getDisplay().syncExec(closeIntroRunnable);
-
- // add a listener for failed operations
- OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(new IOperationHistoryListener() {
-
- public void historyNotification(final OperationHistoryEvent event) {
- if(event.getEventType() == OperationHistoryEvent.OPERATION_NOT_OK) {
- AbstractPapyrusTestCase.this.operationFailed = true;
- }
- }
- });
-
- // disable useless animations (slows down unit tests)
- PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false);
- // maximize the workbench window
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- maximize();
- // closeAllViewsAndEditors();
- }
- });
- // create a project, model, diagram, and open the diagram in the associated Papyrus editor
- projectCreation();
- }
-
- /**
- * Reset the "operation failed" state. Call this before executing each operation for which you want to test whether
- * if failed with {@link AbstractPapyrusTestCase#assertLastOperationSuccessful()}.
- */
- protected void resetLastOperationFailedState() {
- this.operationFailed = false;
- }
-
- /**
- * Asserts that no Command executed on the {@link IOperationHistory} since the last call to
- * {@link AbstractPapyrusTestCase#resetLastOperationFailedState resetLastOperationFailedState} returned
- * {@link OperationHistoryEvent#OPERATION_NOT_OK}.
- *
- */
- protected void assertLastOperationSuccessful() {
- assertFalse("The operation failed. Look at the log, or put a breakpoint on ExecutionException or DefaultOperationHistory#notifyNotOK to find the cause.", this.operationFailed);
- }
-
- protected View getRootView() {
- return getDiagramEditPart().getDiagramView();
- }
-
- protected Element getRootSemanticModel() {
- return (Element)getRootView().getElement();
- }
-
- protected UmlGmfDiagramEditor getDiagramEditor() {
- return this.diagramEditor;
- }
-
- @After
- public void tearDown() throws Exception {
- this.papyrusEditor.doSave(new NullProgressMonitor());
- // diResourceSet.save( new NullProgressMonitor());
- // diagramEditor.close(true);
- this.papyrusEditor = null;
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- closeAllEditors();
- }
- });
- this.project.delete(true, new NullProgressMonitor());
- }
-
- protected void closeAllEditors() {
- this.page.closeAllEditors(false);
- }
-
- protected DiagramEditPart getDiagramEditPart() {
- if(this.diagramEditPart == null) {
- this.diagramEditor = (UmlGmfDiagramEditor)this.papyrusEditor.getActiveEditor();
- final GraphicalViewer graphicalViewer = ((GraphicalViewer)this.diagramEditor.getAdapter(GraphicalViewer.class));
- this.diagramEditPart = (DiagramEditPart)graphicalViewer.getContents().getRoot().getChildren().get(0);
- }
- return this.diagramEditPart;
- }
-
- protected abstract ICreationCommand getDiagramCommandCreation();
-
- protected void projectCreation() throws Exception {
- final IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final IWorkspaceRoot root = workspace.getRoot();
- final String timestamp = Long.toString(System.currentTimeMillis());
- this.project = root.getProject("DiagramTestProject_" + timestamp);
- this.file = this.project.getFile("DiagramTest_" + timestamp + ".di"); //$NON-NLS-2$
- this.diResourceSet = new DiResourceSet();
- // at this point, no resources have been created
- if(!this.project.exists()) {
- this.project.create(null);
- }
- if(!this.project.isOpen()) {
- this.project.open(null);
- }
-
- if(this.file.exists()) {
- this.file.delete(true, new NullProgressMonitor());
- }
-
- if(!this.file.exists()) {
- this.file.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
- this.diResourceSet.createsModels(this.file);
- new CreateUMLModelCommand().createModel(this.diResourceSet);
- // diResourceSet.createsModels(file);
- final ICreationCommand command = getDiagramCommandCreation();
- command.createDiagram(this.diResourceSet, null, "DiagramToTest");
- this.diResourceSet.save(new NullProgressMonitor());
-
- }
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- try {
- openPapyrusEditor();
- } catch (final Exception e) {
- throw new RuntimeException(e);
- }
- }
- });
- }
-
- protected static void maximize() {
- // PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setMaximized(true);
- }
-
- protected static void closeAllViewsAndEditors() {
- // final IWorkbench workbench = PlatformUI.getWorkbench();
- // for(final IWorkbenchWindow workbenchWindow : workbench.getWorkbenchWindows()) {
- // final IWorkbenchPage[] pages = workbenchWindow.getPages();
- // for(final IWorkbenchPage page : pages) {
- // final IViewReference[] viewReferences = page.getViewReferences();
- // for(final IViewReference viewReference : viewReferences) {
- // page.hideView(viewReference);
- // }
- // page.closeAllEditors(false);
- // }
- // }
- }
-
- protected void openPapyrusEditor() throws Exception {
- this.page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- final IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(this.file.getName());
- final IEditorPart editorPart = this.page.openEditor(new FileEditorInput(this.file), desc.getId());
- assertTrue("The editor must be a " + PapyrusMultiDiagramEditor.class.getSimpleName() + " (Actual type: " + editorPart.getClass().getSimpleName() + ")", editorPart instanceof PapyrusMultiDiagramEditor);
- // maximize the editor
- final IWorkbenchPartReference reference = this.page.getReference(editorPart);
- editorPart.getSite().getPage().toggleZoom(reference);
- this.papyrusEditor = ((PapyrusMultiDiagramEditor)editorPart);
- }
-
- /**
- * Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
- * type.
- *
- * <ul>
- * <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
- * <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
- * </ul>
- *
- * @param elementType
- * the type for which to create a view (and possibly a model element)
- * @param parentEditPart
- * the edit part to which the creation request must be sent
- * @return the created View
- */
- protected View createView(final IElementType elementType, final EditPart parentEditPart) {
- return createView(elementType, null, null, parentEditPart);
- }
-
- /**
- * Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
- * type.
- *
- * <ul>
- * <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
- * <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
- * </ul>
- *
- * @param elementType
- * the type for which to create a view (and possibly a model element)
- * @param location
- * the position of the new view (may be <code>null</code>)
- * @param size
- * the size of the new view (may be <code>null</code>)
- * @param parentEditPart
- * the edit part to which the creation request must be sent
- * @return the created View
- */
- protected View createView(final IElementType elementType, final Point location, final Dimension size, final EditPart parentEditPart) {
- final View[] result = new View[1];
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- final CreateViewRequest createRequest = CreateViewRequestFactory.getCreateShapeRequest(elementType, getDiagramEditPart().getDiagramPreferencesHint());
- if(size != null) {
- createRequest.setSize(size);
- }
- if(location != null) {
- createRequest.setLocation(location);
- }
- final Command command = parentEditPart.getCommand(createRequest);
- checkCommand(command);
- execute(command);
-
- result[0] = getCreatedViewFromCommand(command);
- }
- });
- return result[0];
- }
-
- protected static View getCreatedViewFromCommand(final Command command) {
- final List<CreateCommand> createCommands = new ArrayList<CreateCommand>();
- findNestedCreateCommands(command, createCommands);
- assertEquals("There should be one CreateCommand inside the command", 1, createCommands.size());
- final Object returnValue = createCommands.get(0).getCommandResult().getReturnValue();
- if(returnValue instanceof IAdaptable) {
- final IAdaptable adaptableResult = (IAdaptable)returnValue;
- final View view = (View)adaptableResult.getAdapter(View.class);
- if(view != null) {
- return view;
- }
- }
- fail("CreateView command result not found");
- return null;
- }
-
- private static void findNestedCreateCommands(final Command gefCommand, final List<CreateCommand> createCommands) {
- if(gefCommand instanceof CompoundCommand) {
- final CompoundCommand compoundCommand = (CompoundCommand)gefCommand;
- @SuppressWarnings("unchecked")
- final List<Command> commands = compoundCommand.getCommands();
- for(final Command childCommand : commands) {
- findNestedCreateCommands(childCommand, createCommands);
- }
- } else if(gefCommand instanceof ICommandProxy) {
- final ICommandProxy commandProxy = (ICommandProxy)gefCommand;
- final ICommand iCommand = commandProxy.getICommand();
- findNestedCreateCommands(iCommand, createCommands);
- }
- }
-
- private static void findNestedCreateCommands(final ICommand gmfCommand, final List<CreateCommand> createCommands) {
- if(gmfCommand instanceof CompositeCommand) {
- final CompositeCommand compositeCommand = (CompositeCommand)gmfCommand;
- final Iterator<?> iterator = compositeCommand.iterator();
- while(iterator.hasNext()) {
- final Object element = iterator.next();
- if(element instanceof ICommand) {
- final ICommand subCommand = (ICommand)element;
- findNestedCreateCommands(subCommand, createCommands);
- } else {
- fail("error");
- }
- }
- } else if(gmfCommand instanceof CreateCommand) {
- createCommands.add((CreateCommand)gmfCommand);
- } else if(gmfCommand instanceof CommandProxy) {
- final CommandProxy commandProxy = (CommandProxy)gmfCommand;
- findNestedCreateCommands(commandProxy.getCommand(), createCommands);
- }
- }
-
- /**
- * This tests the deletion of the View for the given GraphicalEditPart (this checks that the View is removed, but
- * the semantic model is untouched).
- */
- protected void testHide(final GraphicalEditPart editPart) {
- final EditPart parent = editPart.getParent();
- final int sizeBefore = parent.getChildren().size();
- final EObject semanticElement = ((View)editPart.getModel()).getElement();
- assertTrue("The semantic element should be in a Model", isInModel(semanticElement));
-
- executeHideCommand(editPart);
- assertEquals("The parent edit part should now contain one less child", sizeBefore - 1, parent.getChildren().size());
- assertTrue("The semantic element should still be in the Model after deleting the View", isInModel(semanticElement));
- undo();
- assertEquals("The child should be back after the undo", sizeBefore, parent.getChildren().size());
- assertTrue("The semantic element should still be in the Model after undoing the View deletion", isInModel(semanticElement));
- redo();
- assertEquals("The child should be removed after the redo", sizeBefore - 1, parent.getChildren().size());
- assertTrue("The semantic element should still be in the Model after redoing the View deletion", isInModel(semanticElement));
- }
-
- /**
- * Send the given EditPart a "delete" request (which only deletes the View), and execute the returned command.
- *
- * @param editPart
- * the EditPart to hide
- */
- protected void executeHideCommand(final GraphicalEditPart editPart) {
- final GroupRequest deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- deleteViewRequest.setEditParts(editPart);
- final Command command = editPart.getCommand(deleteViewRequest);
- checkCommand(command);
- execute(command);
- }
-
- /** This tests the destruction of both the model and View for the given GraphicalEditPart. */
- protected void testDelete(final GraphicalEditPart editPart) {
- final EditPart parent = editPart.getParent();
- final int sizeBefore = parent.getChildren().size();
- final EObject semanticElement = ((View)editPart.getModel()).getElement();
- assertTrue("The semantic element should be in a Model", isInModel(semanticElement));
-
- executeDestroyCommand(editPart);
- assertEquals("The parent edit part should now contain one less child", sizeBefore - 1, parent.getChildren().size());
- assertFalse("The semantic element should not be in the Model any more after deleting it", isInModel(semanticElement));
- undo();
- assertEquals("The child should be back after the undo", sizeBefore, parent.getChildren().size());
- assertTrue("The semantic element should be back in the Model after undoing the deletion", isInModel(semanticElement));
- redo();
- assertEquals("The child should be removed after the redo", sizeBefore - 1, parent.getChildren().size());
- assertFalse("The semantic element should not be in the Model after redoing the deletion", isInModel(semanticElement));
- }
-
- /**
- * Send the given EditPart a {@link DestroyElementRequest}, and execute the returned command.
- *
- * @param editPart
- * the EditPart to destroy
- */
- protected void executeDestroyCommand(final GraphicalEditPart editPart) {
- final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- final Command command = editPart.getCommand(destroyElementRequest);
- checkCommand(command);
- execute(command);
- }
-
- /**
- * @param targetEditPart
- * the EditPart on top of which the drop will happen. This will determine the coordinates of the drop.
- * @param parentEditPart
- * the EditPart in which the element will really be added. Often the same EditPart as targetEditPart,
- * unless dropping on top of the first EditPart puts the element in another edit part.
- * @param droppedElement
- * the element to drop
- */
- public void testDrop(final GraphicalEditPart targetEditPart, final GraphicalEditPart parentEditPart, final EObject droppedElement) {
- final int sizeBefore = parentEditPart.getChildren().size();
- final DropObjectsRequest dropObjectsRequest = new DropObjectsRequest();
- final ArrayList<EObject> list = new ArrayList<EObject>();
- list.add(droppedElement);
- dropObjectsRequest.setObjects(list);
- dropObjectsRequest.setLocation(new Point(1, 1));
- final Command command = targetEditPart.getCommand(dropObjectsRequest);
- checkCommand(command);
- execute(command);
- assertEquals("The parent edit part should now contain one more child", sizeBefore + 1, parentEditPart.getChildren().size());
- assertTrue("The dropped element should now be in the Model", isInModel(droppedElement));
- undo();
- assertEquals("The editpart should be removed after undo", sizeBefore, parentEditPart.getChildren().size());
- assertTrue("The semantic element should still be in the Model after undoing the drop", isInModel(droppedElement));
- redo();
- assertEquals("The parent edit part should contain one more child after redo", sizeBefore + 1, parentEditPart.getChildren().size());
- assertTrue("The dropped element should be in the Model after redo", isInModel(droppedElement));
- }
-
- /**
- * Return whether the given model element is contained by a UML {@link Model}. This is useful in order to determine
- * if an element was deleted (removed from the Model).
- */
- protected static boolean isInModel(final EObject semanticElement) {
- EObject parent = semanticElement.eContainer();
- while(parent != null) {
- if(parent instanceof Model) {
- return true;
- }
- parent = parent.eContainer();
- }
- return false;
- }
-
- /** Check that the given command is executable. */
- protected static void checkCommand(final Command command) {
- assertNotNull("The command must not be null", command);
- assertTrue("The command must be executable", command.canExecute());
- }
-
- /** The command stack to use to execute commands on the diagram. */
- protected CommandStack getCommandStack() {
- // not "diagramEditor.getDiagramEditDomain().getDiagramCommandStack()" because it messes up undo contexts
- return this.diagramEditor.getEditingDomain().getCommandStack();
- }
-
- /** Execute the given command in the diagram editor. */
- protected void execute(final Command command) {
- resetLastOperationFailedState();
- getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
- assertLastOperationSuccessful();
- }
-
- /** Undo the last command done in the diagram editor. */
- protected void undo() {
- resetLastOperationFailedState();
- final CommandStack commandStack = getCommandStack();
- assertTrue("We should be able to undo", commandStack.canUndo());
- commandStack.undo();
- assertLastOperationSuccessful();
- }
-
- /** Redo the last command undone in the diagram editor. */
- protected void redo() {
- resetLastOperationFailedState();
- final CommandStack commandStack = getCommandStack();
- assertTrue("We should be able to redo", commandStack.canRedo());
- commandStack.redo();
- assertLastOperationSuccessful();
- }
-
- /** Call {@link AbstractPapyrusTestCase#execute(Command) execute} on the UI thread. */
- protected void executeOnUIThread(final Command command) {
- execute(command);
- // Display.getDefault().syncExec(new Runnable() {
- //
- // public void run() {
- // execute(command);
- // }
- // });
- }
-
- /** Call {@link AbstractPapyrusTestCase#undo() undo} on the UI thread. */
- protected void undoOnUIThread() {
- undo();
- // Display.getDefault().syncExec(new Runnable() {
- //
- // public void run() {
- // undo();
- // }
- // });
- }
-
- /** Call {@link AbstractPapyrusTestCase#redo() redo} on the UI thread. */
- protected void redoOnUIThread() {
- redo();
- // Display.getDefault().syncExec(new Runnable() {
- //
- // public void run() {
- // redo();
- // }
- // });
- }
-
- /**
- * Delete the View associated with the given EditPart, so that it is effectively hidden from the diagram without
- * removing the corresponding semantic element.
- */
- protected void hide(final GraphicalEditPart editPart) {
- final Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- final Command command = editPart.getCommand(deleteViewRequest);
- execute(command);
- }
-
- // protected void sendKey(final Control control, final int key) {
- // if (!control.setFocus()) {
- // throw new RuntimeException("Cannot give focus to the control");
- // }
- //
- // final Display display = Display.getDefault();
- // final Event keyDownEvent = new Event();
- // keyDownEvent.type = SWT.KeyDown;
- // keyDownEvent.keyCode = key;
- // display.post(keyDownEvent);
- // final Event keyUpEvent = new Event();
- // keyUpEvent.type = SWT.KeyUp;
- // keyUpEvent.keyCode = key;
- // display.post(keyUpEvent);
- // }
-
- protected interface INameProvider<T extends EObject> {
-
- String getName(T element);
- }
-
- /**
- * Test setting the name on the given editPart, using a DirectEditRequest. Check that the name is set on the given
- * named element. Also test undo and redo.
- */
- protected <T extends EObject> void testSetNameWithDirectEditRequest(final GraphicalEditPart editPart, final T element, final INameProvider<T> nameProvider) {
- // set first name
- final String name1 = "test name 1 " + System.currentTimeMillis();
- setNameWithDirectEditRequest(editPart, name1);
- assertEquals("The element should have the first name", name1, nameProvider.getName(element));
- // set second name
- final String name2 = "test name 2 " + System.currentTimeMillis();
- setNameWithDirectEditRequest(editPart, name2);
- assertEquals("The element should have the second name", name2, nameProvider.getName(element));
- // test undo
- undo();
- assertEquals("The element name should be reset to the first name after undo", name1, nameProvider.getName(element));
- // test redo
- redo();
- assertEquals("The element name should be reset to the second name after redo", name2, nameProvider.getName(element));
- }
-
- /**
- * Test setting the name on the given editPart, using a DirectEditRequest. Check that the name is set on the given
- * named element. Also test undo and redo.
- */
- protected void testSetNameWithDirectEditRequest(final GraphicalEditPart editPart, final NamedElement namedElement) {
- testSetNameWithDirectEditRequest(editPart, namedElement, new INameProvider<NamedElement>() {
-
- public String getName(final NamedElement element) {
- return element.getName();
- }
- });
- }
-
- /**
- * Set the name of the given GraphicalEditPart (which must be a name edit part) using a DirectEditRequest. This sets
- * the name in the Text widget that appears as a result of the DirectEditRequest, and then closes the Text widget to
- * accept the changes.
- *
- * @param editPart
- * the edit part on which to perform the DirectEditRequest.
- * @param newName
- * the name to set
- */
- protected void setNameWithDirectEditRequest(final GraphicalEditPart editPart, final String newName) {
- final IFigure nameFigure = editPart.getFigure();
- final Rectangle bounds = nameFigure.getBounds();
- final Point center = bounds.getCenter();
- final DirectEditRequest directEditRequest = new DirectEditRequest();
- directEditRequest.setLocation(center);
- final Text textWidget = performDirectEditRequest(editPart, directEditRequest);
- setText(textWidget, newName);
- }
-
- /** Changes the text of the given Text widget, and then removes the focus from this text in order to commit changes. */
- protected static void setText(final Text textWidget, final String newName) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- textWidget.setText(newName);
- // change the focus in order to accept the text
- textWidget.getShell().setFocus();
- }
- });
- }
-
- /**
- * Performs the given DirectEditRequest on the given EditPart, and returns the Text widget that appears to let the
- * user edit the label.
- */
- protected Text performDirectEditRequest(final EditPart editPart, final DirectEditRequest directEditRequest) {
- final Text[] result = new Text[1];
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- // note: both operations need to be performed in the same display runnable
- editPart.performRequest(directEditRequest);
- result[0] = findVisibleTextWidgetOnDiagram();
- }
- });
- assertNotNull("The DirectEditRequest should open a Text field", result[0]);
- return result[0];
- }
-
- /**
- * Click the palette tool with the given id on the center of the given EditPart's Figure.
- *
- * @param toolId
- * the id of the tool to click
- * @param target
- * what to click
- */
- protected void clickTool(final String toolId, final GraphicalEditPart target) {
- final Point point = getCenterPoint(target);
- clickTool(toolId, point);
- }
-
- /**
- * Click the palette tool with the given id at the given location.
- *
- * @param toolId
- * the id of the tool to click
- * @param point
- * where to click
- */
- protected void clickTool(final String toolId, final Point point) {
- final Tool tool = createTool(toolId);
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- tool.activate();
- internalClickTool(tool, point);
- tool.deactivate();
- }
- });
- }
-
- protected void clickTwiceWithTool(final String toolId, final GraphicalEditPart firstTarget, final GraphicalEditPart secondTarget) {
- final Point firstPoint = getCenterPoint(firstTarget);
- final Point secondPoint = getCenterPoint(secondTarget);
- clickTwiceWithTool(toolId, firstPoint, secondPoint);
- }
-
- protected void clickTwiceWithTool(final String toolId, final Point firstPoint, final Point secondPoint) {
- final Tool tool = createTool(toolId);
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- tool.activate();
- internalClickTool(tool, firstPoint);
- internalClickTool(tool, secondPoint);
- tool.deactivate();
- }
- });
- }
-
- private Tool createTool(final String toolId) {
- final PaletteViewer paletteViewer = ((EditDomain)this.diagramEditor.getDiagramEditDomain()).getPaletteViewer();
- final ToolEntry toolEntry = findToolEntry(toolId, paletteViewer.getPaletteRoot());
- assertNotNull("The tool with id " + toolId + " was not found in the palette", toolEntry); //$NON-NLS-2$
- final Tool tool = toolEntry.createTool();
- assertNotNull("The tool with id " + toolId + " couldn't be created", tool); //$NON-NLS-2$
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- initializeTool(tool);
- }
- });
- return tool;
- }
-
- protected void initializeTool(final Tool tool) {
- tool.setViewer(this.diagramEditor.getDiagramGraphicalViewer());
- tool.setEditDomain((EditDomain)this.diagramEditor.getDiagramEditDomain());
- }
-
- /**
- * Find a tool with the given id in the given palette container.
- *
- * @param toolId
- * the id of the tool to return
- * @param paletteContainer
- * the palette root
- * @return the tool entry, from which a new instance of the tool can be created
- */
- protected ToolEntry findToolEntry(final String toolId, final PaletteContainer paletteContainer) {
- final List<?> children = paletteContainer.getChildren();
- for(final Object child : children) {
- if(child instanceof PaletteContainer) {
- final PaletteContainer childContainer = (PaletteContainer)child;
- final ToolEntry subresult = findToolEntry(toolId, childContainer);
- if(subresult != null) {
- return subresult;
- }
- } else if(child instanceof ToolEntry) {
- final ToolEntry toolEntry = (ToolEntry)child;
- if(toolId.equals(toolEntry.getId())) {
- return toolEntry;
- }
- }
- }
- return null;
- }
-
- /**
- * Emulate a click of the given tool at the given point on the diagram (the tool should be {@link Tool#activate()
- * activated}.
- */
- protected void internalClickTool(final Tool tool, final Point point) {
- final Event event = new Event();
- event.x = point.x;
- event.y = point.y;
- event.widget = this.diagramEditor.getDiagramGraphicalViewer().getControl();
- event.button = 1;
- // final MouseEvent mouseEvent = new MouseEvent(null, figure, );
- final MouseEvent mouseEvent = new MouseEvent(event);
- event.type = SWT.MouseMove;
- tool.mouseMove(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
- event.type = SWT.MouseDown;
- tool.mouseDown(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
- event.type = SWT.MouseUp;
- tool.mouseUp(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
- }
-
- /**
- * Send an SelectionRequest of type "open" to the given EditPart (this is what happens when the user double-clicks).
- */
- protected static void sendOpenSelectionRequest(final GraphicalEditPart graphicalEditPart, final Point point) {
- final SelectionRequest openRequest = new SelectionRequest();
- openRequest.setType(RequestConstants.REQ_OPEN);
- openRequest.setLastButtonPressed(0);
- openRequest.setLocation(point);
- graphicalEditPart.performRequest(openRequest);
- }
-
- /** Finds a {@link Text} widget inside the diagram control ({@link FigureCanvas}). */
- protected Text findVisibleTextWidgetOnDiagram() {
- final Text[] result = new Text[1];
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- final Composite composite = (Composite)getDiagramEditor().getDiagramGraphicalViewer().getControl();
- result[0] = findVisibleTextWidget(composite);
- }
- });
- return result[0];
- }
-
- /** Finds a {@link Text} widget inside the given composite, recursively. */
- protected Text findVisibleTextWidget(final Composite composite) {
- final Control[] children = composite.getChildren();
- for(final Control child : children) {
- if(child instanceof Text) {
- final Text text = (Text)child;
- if(text.isVisible()) {
- return text;
- }
- } else if(child instanceof Composite) {
- final Composite childComposite = (Composite)child;
- final Text subresult = findVisibleTextWidget(childComposite);
- if(subresult != null) {
- return subresult;
- }
- }
- }
- return null;
- }
-
- /**
- * Find the EditPart corresponding to the given View, or <code>null</code> if it doesn't exist, or is not registered
- * in the viewer's visual part map.
- *
- * @param view
- * the view for which to find a corresponding EditPart
- * @return the EditPart corresponding to the View
- */
- protected EditPart findEditPart(final View view) {
- final Object result = this.diagramEditPart.getRoot().getViewer().getVisualPartMap().get(view);
- assertTrue("The EditPart corresponding to the View was not found", result instanceof EditPart);
- return (EditPart)result;
- }
-
- /** Processes all events waiting in the Display's event loop and then returns. */
- protected static void flushEventLoop() {
- final Display display = Display.getDefault();
- display.syncExec(new Runnable() {
-
- public void run() {
- while(display.readAndDispatch()) {
- // nothing
- }
- }
- });
- }
-
- /**
- * Move the given EditPart in its parent.
- *
- * @param editPartToMove
- * the EditPart to move
- * @param parentEditPart
- * the parent
- * @param moveDelta
- * the offset
- */
- protected void moveEditPart(final GraphicalEditPart editPartToMove, final GraphicalEditPart parentEditPart, final Point moveDelta) {
- moveEditParts(Collections.singletonList(editPartToMove), parentEditPart, moveDelta);
- }
-
- /**
- * Resize the given EditPart in its parent.
- *
- * @param editPartToResize
- * the EditPart to resize
- * @param parentEditPart
- * the parent
- * @param resizeDelta
- * the size offset
- * @param direction
- * the direction to resize (cf {@link PositionConstants})
- */
- protected void resizeEditPart(final GraphicalEditPart editPartToResize, final GraphicalEditPart parentEditPart, final Dimension resizeDelta, final int direction) {
- resizeEditParts(Collections.singletonList(editPartToResize), parentEditPart, resizeDelta, direction);
- }
-
- /**
- * Move the given EditParts in their parent.
- *
- * @param editPartsToMove
- * the EditParts to move
- * @param parentEditPart
- * the parent
- * @param moveDelta
- * the location offset
- */
- protected void moveEditParts(final List<? extends GraphicalEditPart> editPartsToMove, final GraphicalEditPart parentEditPart, final Point moveDelta) {
- if(editPartsToMove.size() < 1 || parentEditPart == null || moveDelta == null) {
- throw new IllegalArgumentException();
- }
- final ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest();
- changeBoundsRequest.setType(RequestConstants.REQ_MOVE_CHILDREN);
- // emulate a drag&drop with the mouse over the first EditPart
- changeBoundsRequest.setLocation(computeLocationWithDelta(editPartsToMove.get(0), moveDelta));
- changeBoundsRequest.setMoveDelta(moveDelta);
- changeBoundsRequest.setEditParts(editPartsToMove);
- final Command command = parentEditPart.getCommand(changeBoundsRequest);
- checkCommand(command);
- executeOnUIThread(command);
- flushEventLoop();
- }
-
- /**
- * Resize the given EditParts in their parent.
- *
- * @param editPartsToMove
- * the EditParts to resize
- * @param parentEditPart
- * the parent
- * @param resizeDelta
- * the size offset
- * @param direction
- * the direction to resize (cf {@link PositionConstants})
- */
- protected void resizeEditParts(final List<? extends GraphicalEditPart> editPartsToResize, final GraphicalEditPart parentEditPart, final Dimension resizeDelta, final int direction) {
- if(editPartsToResize.size() < 1 || parentEditPart == null || resizeDelta == null) {
- throw new IllegalArgumentException();
- }
- final ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest();
- changeBoundsRequest.setType(RequestConstants.REQ_RESIZE_CHILDREN);
- changeBoundsRequest.setLocation(computeLocationWithDelta(editPartsToResize.get(0), new Point(resizeDelta.width, resizeDelta.height)));
- changeBoundsRequest.setMoveDelta(new Point());
- changeBoundsRequest.setSizeDelta(resizeDelta);
- changeBoundsRequest.setResizeDirection(direction);
- changeBoundsRequest.setEditParts(editPartsToResize);
- final Command command = parentEditPart.getCommand(changeBoundsRequest);
- checkCommand(command);
- executeOnUIThread(command);
- flushEventLoop();
- }
-
- /**
- * Compute a Location for the mouse pointer that would occur when dragging the center of the given EditPart by the
- * given translation vector.
- *
- * @param graphicalEditPart
- * the EditPart being dragged
- * @param moveDelta
- * the offset (the translation vector)
- * @return the target Location
- */
- private static Point computeLocationWithDelta(final GraphicalEditPart graphicalEditPart, final Point moveDelta) {
- return getAbsoluteBounds(graphicalEditPart).getCenter().translate(moveDelta);
- }
-
- protected static Rectangle getBounds(final GraphicalEditPart graphicalEditPart) {
- return new Rectangle(graphicalEditPart.getFigure().getBounds());
- }
-
- /** Return the center of the given EditPart's Figure, in absolute coordinates. */
- protected static Point getCenterPoint(final GraphicalEditPart editPart) {
- final Rectangle bounds = new Rectangle(editPart.getFigure().getBounds());
- editPart.getFigure().getParent().translateToAbsolute(bounds);
- final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
- return point;
- }
-
- protected static Rectangle getAbsoluteBounds(final GraphicalEditPart graphicalEditPart) {
- final Rectangle bounds = getBounds(graphicalEditPart);
- graphicalEditPart.getFigure().getParent().translateToAbsolute(bounds);
- return bounds;
- }
-
- /**
- * Check that undo and redo work correctly after moving/resizing an EditPart (the EditPart must have been
- * moved/resized before calling this method).
- *
- * @param editPart
- * an EditPart that was just moved/resized
- * @param boundsBefore
- * the bounds of this EditPart before it was moved/resized
- */
- protected void testUndoRedoChangeBoundsEditPart(final GraphicalEditPart editPart, final Rectangle boundsBefore) {
- final Rectangle boundsAfter = getBounds(editPart);
-
- // test undo
- undoOnUIThread();
- flushEventLoop();
- Rectangle bounds = getBounds(editPart);
- assertEquals("The bounds change should be undone", boundsBefore, bounds);
-
- // test redo
- redoOnUIThread();
- flushEventLoop();
- bounds = getBounds(editPart);
- assertEquals("The bounds change should be redone", boundsAfter, bounds);
- }
-
- /**
- * Check the bounds of the given GraphicalEditPart's Figure
- *
- * @param graphicalEditPart
- * The EditPart whose Figure's bounds to check
- * @param expectedPosition
- * the expected position (-1 for any of the coordinates means not to check this coordinate)
- * @param expectedSize
- * the expected size (-1 for any of the coordinates means not to check this coordinate)
- * @param xErrorMargin
- * an error margin for the horizontal position
- * @param yErrorMargin
- * an error margin for the vertical position
- * @param widthErrorMargin
- * an error margin for the width
- * @param heightErrorMargin
- * an error margin for the height
- */
- protected static void assertBounds(final GraphicalEditPart graphicalEditPart, final Point expectedPosition, final Dimension expectedSize, final int xErrorMargin, final int yErrorMargin, final int widthErrorMargin, final int heightErrorMargin) {
- assertBounds(graphicalEditPart, new Rectangle(expectedPosition, expectedSize), xErrorMargin, yErrorMargin, widthErrorMargin, heightErrorMargin);
- }
-
- /**
- * Check the bounds of the given GraphicalEditPart's Figure
- *
- * @param graphicalEditPart
- * The EditPart whose Figure's bounds to check
- * @param expectedBounds
- * the expected bounds (-1 for any of the coordinates means not to check this coordinate)
- * @param xErrorMargin
- * an error margin for the horizontal position
- * @param yErrorMargin
- * an error margin for the vertical position
- * @param widthErrorMargin
- * an error margin for the width
- * @param heightErrorMargin
- * an error margin for the height
- */
- protected static void assertBounds(final GraphicalEditPart graphicalEditPart, final Rectangle expectedBounds, final int xErrorMargin, final int yErrorMargin, final int widthErrorMargin, final int heightErrorMargin) {
- // let GMF do its layout so that the bounds are correct
- flushEventLoop();
- final Rectangle bounds = getBounds(graphicalEditPart);
- if(expectedBounds.width != -1) {
- assertTrue("The element should be about " + expectedBounds.width + " pixels wide", Math.abs(bounds.width - expectedBounds.width) <= widthErrorMargin);
- }
- if(expectedBounds.height != -1) {
- assertTrue("The element should be about " + expectedBounds.height + " pixels high", Math.abs(bounds.height - expectedBounds.height) <= heightErrorMargin);
- }
- if(expectedBounds.x != -1) {
- assertTrue("The element should have a horizontal position at about " + expectedBounds.x + " pixels", Math.abs(bounds.x - expectedBounds.x) <= xErrorMargin);
- }
- if(expectedBounds.y != -1) {
- assertTrue("The element should have a vertical position at about " + expectedBounds.y + " pixels", Math.abs(bounds.y - expectedBounds.y) <= yErrorMargin);
- }
- }
-
- /**
- * Find the EditPart corresponding to the given View in the given parent EditPart's children.
- *
- * @param parentEditPart
- * the EditPart in which the EditPart we are looking for should be found
- * @param view
- * the View corresponding to the searched EditPart
- * @return the found EditPart
- */
- protected static EditPart findChildEditPartAssociatedToView(final EditPart parentEditPart, final View view) {
- EditPart result = null;
- @SuppressWarnings("unchecked")
- final List<EditPart> children = parentEditPart.getChildren();
- for(final EditPart editPart : children) {
- if(view == editPart.getModel()) {
- result = editPart;
- }
- }
- assertNotNull("There should be an EditPart corresponding to the View", result);
- return result;
-
- }
-
-}

Back to the top