Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2017-12-06 11:20:51 +0000
committerLaurent Redor2017-12-06 16:48:07 +0000
commit9a042693b965e5db6aa31dea04aa3a2dc6245195 (patch)
treefa94f7fbb879b75c98bdea2e7a5b92a3e0e7a480
parent2ca75c75795a88aca71321d791b3006ee19c3e49 (diff)
downloadorg.eclipse.sirius-9a042693b965e5db6aa31dea04aa3a2dc6245195.tar.gz
org.eclipse.sirius-9a042693b965e5db6aa31dea04aa3a2dc6245195.tar.xz
org.eclipse.sirius-9a042693b965e5db6aa31dea04aa3a2dc6245195.zip
[525933] Fix regression in test test_DnDClassFromMC2DiagramBlank5
For commit [1] 641c44b9, an existing representation description of a VSM has been completed with a transient layer. But this new transient layer has a side effect on an existing test. This commit adds a new representation description and a new corresponding representation for the test test_DnDClassFromMC2DiagramBlank6FromATransientLayerTool(). The test test_DnDClassFromMC2DiagramBlank5() is no longer impacted. [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=641c44b9275f78ce9ed31b72fabe0bdf44ff100e bug: 525933 Change-Id: I33ba3a50d438a4f7f133939e509f91844d591b67 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.aird11
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.odesign51
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java23
3 files changed, 79 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.aird
index 34afff8a0a..a6f609ce92 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.aird
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.aird
@@ -24,6 +24,17 @@
<activatedLayers xmi:type="description_1:Layer" href="tc1041.odesign#//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%205%20Blank']/@defaultLayer"/>
<target xmi:type="ecore:EPackage" href="tc1041.ecore#/"/>
</ownedRepresentations>
+ <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_Vk3lgA2nEeC5sN0Dpug5Px" name="new TC1041 representation 6 Blank">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_Vk3lgg2nEeC5sN0Dpug5Px" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_Vk3lgw2nEeC5sN0Dpug5Px" type="Sirius" element="_Vk3lgA2nEeC5sN0Dpug5Px" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_Vk3lhA2nEeC5sN0Dpug5Px"/>
+ </data>
+ </ownedAnnotationEntries>
+ <description xmi:type="description_1:DiagramDescription" href="tc1041.odesign#//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_Vk3lgQ2nEeC5sN0Dpug5Px"/>
+ <activatedLayers xmi:type="description_1:Layer" href="tc1041.odesign#//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer"/>
+ <target xmi:type="ecore:EPackage" href="tc1041.ecore#/"/>
+ </ownedRepresentations>
<viewpoint xmi:type="description:Viewpoint" href="tc1041.odesign#//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']"/>
</ownedViews>
</viewpoint:DAnalysis>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.odesign
index 1a595e991f..221301b6dd 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.odesign
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/dragAndDrop/tc-1041/tc1041.odesign
@@ -142,7 +142,7 @@
</toolSections>
</defaultLayer>
</ownedRepresentations>
- <ownedRepresentations xsi:type="description_1:DiagramDescription" dropDescriptions="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%205%20Blank']/@defaultLayer/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EPackage%20R5'] //@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%205%20Blank']/@additionalLayers[name='transientLayer']/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EClass%20R5-transient']" name="TC1041 representation 5 Blank" domainClass="EPackage" enablePopupBars="true">
+ <ownedRepresentations xsi:type="description_1:DiagramDescription" dropDescriptions="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%205%20Blank']/@defaultLayer/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EPackage%20R5']" name="TC1041 representation 5 Blank" domainClass="EPackage" enablePopupBars="true">
<defaultLayer name="Default">
<nodeMappings name="Node EClass R5" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EClass)" createElements="false" domainClass="EClass">
<style xsi:type="style:SquareDescription">
@@ -188,9 +188,56 @@
</ownedTools>
</toolSections>
</defaultLayer>
+ </ownedRepresentations>
+ <ownedRepresentations xsi:type="description_1:DiagramDescription" dropDescriptions="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EPackage%20R5'] //@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@additionalLayers[name='transientLayer']/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EClass%20R5-transient']" name="TC1041 representation 6 Blank" domainClass="EPackage" enablePopupBars="true">
+ <defaultLayer name="Default">
+ <nodeMappings name="Node EClass R5" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EClass)" createElements="false" domainClass="EClass">
+ <style xsi:type="style:SquareDescription">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='purple']"/>
+ </style>
+ </nodeMappings>
+ <containerMappings name="Container EPackage R5" semanticCandidatesExpression="aql:self.eContents()->filter(ecore::EPackage)" createElements="false" domainClass="EPackage" dropDescriptions="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@toolSections.0/@ownedTools[name='Drag%20%26%20Drop%20EClass%20R5']" reusedNodeMappings="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@nodeMappings[name='Node%20EClass%20R5']">
+ <style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_purple']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
+ <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/>
+ </style>
+ </containerMappings>
+ <toolSections name="tools">
+ <ownedTools xsi:type="tool:ContainerDropDescription" name="Drag &amp; Drop EPackage R5" forceRefresh="true" mappings="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@containerMappings[name='Container%20EPackage%20R5']" dragSource="BOTH">
+ <oldContainer name="oldSemanticContainer"/>
+ <newContainer name="newSemanticContainer"/>
+ <element name="element"/>
+ <newViewContainer name="newContainerView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:element">
+ <subModelOperations xsi:type="tool_1:If" conditionExpression="aql:element.oclIsTypeOf(ecore::EPackage)">
+ <subModelOperations xsi:type="tool_1:MoveElement" newContainerExpression="var:newSemanticContainer" featureName="eSubpackages"/>
+ </subModelOperations>
+ </firstModelOperations>
+ </initialOperation>
+ </ownedTools>
+ <ownedTools xsi:type="tool:ContainerDropDescription" name="Drag &amp; Drop EClass R5" forceRefresh="true" mappings="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@nodeMappings[name='Node%20EClass%20R5']" dragSource="BOTH">
+ <oldContainer name="oldSemanticContainer"/>
+ <newContainer name="newSemanticContainer"/>
+ <element name="element"/>
+ <newViewContainer name="newContainerView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:element">
+ <subModelOperations xsi:type="tool_1:If" conditionExpression="aql:element.oclIsTypeOf(ecore::EClass)">
+ <subModelOperations xsi:type="tool_1:MoveElement" newContainerExpression="var:newSemanticContainer" featureName="eClassifiers"/>
+ </subModelOperations>
+ </firstModelOperations>
+ </initialOperation>
+ </ownedTools>
+ </toolSections>
+ </defaultLayer>
<additionalLayers name="transientLayer" activeByDefault="true">
<toolSections name="tools">
- <ownedTools xsi:type="tool:ContainerDropDescription" name="Drag &amp; Drop EClass R5-transient" forceRefresh="true" mappings="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%205%20Blank']/@defaultLayer/@nodeMappings[name='Node%20EClass%20R5']" dragSource="BOTH">
+ <ownedTools xsi:type="tool:ContainerDropDescription" name="Drag &amp; Drop EClass R5-transient" forceRefresh="true" mappings="//@ownedViewpoints[name='Test%20case%20for%20ticket%20%231041']/@ownedRepresentations[name='TC1041%20representation%206%20Blank']/@defaultLayer/@nodeMappings[name='Node%20EClass%20R5']" dragSource="BOTH">
<oldContainer name="oldSemanticContainer"/>
<newContainer name="newSemanticContainer"/>
<element name="element"/>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
index 57808f13e1..e15c29d2ee 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
@@ -61,10 +61,14 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
private static final String REPRESENTATION_INSTANCE_5BLANK = "new TC1041 representation 5 Blank";
+ private static final String REPRESENTATION_INSTANCE_6BLANK = "new TC1041 representation 6 Blank";
+
private static final String REPRESENTATION_NAME_2 = "TC1041 representation 2 Blank";
private static final String REPRESENTATION_NAME_5 = "TC1041 representation 5 Blank";
+ private static final String REPRESENTATION_NAME_6 = "TC1041 representation 6 Blank";
+
private static final String MODEL = "tc1041.ecore";
private static final String SESSION_FILE = "tc1041.aird";
@@ -146,9 +150,20 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
}
/**
+ * Open "TC1041 representation 6 Blank" diagram.
+ */
+ private void openRepresentation6() {
+ editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_6, REPRESENTATION_INSTANCE_6BLANK, DDiagram.class);
+ if (snapToGrid) {
+ editor.setSnapToGrid(true, GRID_STEP, 2);
+ }
+ }
+
+ /**
* @throws Exception
- * Test the drag&drop of P1(EPackage) from the Model Content view to the diagram. This test is done on a
- * "TC1041 representation 2 Blank" diagram.
+ * Test the drag&drop of P1(EPackage) from the Model Content
+ * view to the diagram. This test is done on a "TC1041
+ * representation 2 Blank" diagram.
*/
@Test
public void test_DnDPackageFromMC2DiagramBlank2() throws Exception {
@@ -709,9 +724,9 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
* In case of problem
*/
@Test
- public void test_DnDClassFromMC2DiagramBlank5FromATransientLayerTool() throws Exception {
+ public void test_DnDClassFromMC2DiagramBlank6FromATransientLayerTool() throws Exception {
- openRepresentation5();
+ openRepresentation6();
try {
openErrorLogViewByAPI();

Back to the top