aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghillairet2012-05-15 11:21:19 (EDT)
committermgolubev2012-05-15 11:21:19 (EDT)
commit6382d2be9714a02413f6af2a9ac5b55b7fe7c4c9 (patch)
tree31ee4e347ecca6d504347085f264fc5763702b3c
parent3789b7d9569493fa5511275071b8faab3f517557 (diff)
downloadorg.eclipse.gmf-tooling-6382d2be9714a02413f6af2a9ac5b55b7fe7c4c9.zip
org.eclipse.gmf-tooling-6382d2be9714a02413f6af2a9ac5b55b7fe7c4c9.tar.gz
org.eclipse.gmf-tooling-6382d2be9714a02413f6af2a9ac5b55b7fe7c4c9.tar.bz2
removed old tests
-rw-r--r--tests/org.eclipse.gmf.tests/models/tests/audits.gmfmap133
-rw-r--r--tests/org.eclipse.gmf.tests/models/tests/compartments_ref_node.gmfmap78
-rw-r--r--tests/org.eclipse.gmf.tests/models/tests/nodes_labels.gmfmap98
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java5
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareAbstractTest.java599
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareTestSupport.java539
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonAudtisTest.java19
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonCompartmentRefNodeTest.java19
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonFullTest.java19
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonLinksTest.java19
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonNodeLabelsTest.java19
11 files changed, 0 insertions, 1547 deletions
diff --git a/tests/org.eclipse.gmf.tests/models/tests/audits.gmfmap b/tests/org.eclipse.gmf.tests/models/tests/audits.gmfmap
deleted file mode 100644
index 6ab7377..0000000
--- a/tests/org.eclipse.gmf.tests/models/tests/audits.gmfmap
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<gmfmap:Mapping xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
- xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
- <nodes>
- <containmentFeature
- href="test.ecore#//UltimateContainer/all"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//NodeSrcA"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- <features
- href="test.ecore#//NodeSrcA/label"/>
- </labelMappings>
- <contextMenu
- href="test.gmftool#//@allMenus.1"/>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- <children>
- <containmentFeature
- href="test.ecore#//NodeSrcA/children1OfA"/>
- <childrenFeature
- href="test.ecore#//NodeSrcA/children1OfA"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//Child"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- <features
- href="test.ecore#//Child/childLabel"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- </ownedChild>
- </children>
- </ownedChild>
- </nodes>
- <diagram>
- <diagramCanvas
- href="test.gmfgraph#Test-dd-canvas"/>
- <domainModel
- href="test.ecore#/"/>
- <domainMetaElement
- href="test.ecore#//UltimateContainer"/>
- <palette
- href="test.gmftool#//@palette"/>
- <menuContributions
- href="test.gmftool#//@allMenus.0"/>
- </diagram>
- <audits
- id="test"
- name="test"
- description="All Audits">
- <audits
- name="Node Label"
- description="Empty node label check"
- id="node_label"
- message="Node label should not be empty">
- <rule
- body="label.size() > 0"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="test.ecore#//NodeSrcA"/>
- </target>
- </audits>
- <audits
- name="Node Label 2"
- description="Node Label should be set"
- id="node_label_2"
- severity="WARNING"
- message="Node Label should be set">
- <rule
- body="size() > 0"/>
- <target
- xsi:type="gmfmap:DomainAttributeTarget">
- <attribute
- href="test.ecore#//NodeSrcA/label"/>
- </target>
- </audits>
- <audits
- name="Node Type"
- description="Node type check"
- id="node_type"
- message="Invalid Node Type">
- <rule
- body="element.eClass().name = 'NodeSrcA'"/>
- <target
- xsi:type="gmfmap:DiagramElementTarget"
- element="//@nodes.0/@ownedChild"/>
- </audits>
- <audits
- name="Node Audit Metric"
- description="Some Audit Metric"
- id="NodeAuditMetric"
- message="Some Stuff">
- <rule
- body="true"/>
- <target
- xsi:type="gmfmap:AuditedMetricTarget"
- metric="//@metrics/@metrics.0"/>
- </audits>
- </audits>
- <metrics>
- <metrics
- name="Node Metric"
- description="Some Metric"
- key="NodeMetric"
- lowLimit="5.0"
- highLimit="10.0">
- <rule
- body="label->size()"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="test.ecore#//NodeSrcA"/>
- </target>
- </metrics>
- </metrics>
-</gmfmap:Mapping>
diff --git a/tests/org.eclipse.gmf.tests/models/tests/compartments_ref_node.gmfmap b/tests/org.eclipse.gmf.tests/models/tests/compartments_ref_node.gmfmap
deleted file mode 100644
index c94e213..0000000
--- a/tests/org.eclipse.gmf.tests/models/tests/compartments_ref_node.gmfmap
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfmap:Mapping xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
- xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
- <nodes>
- <containmentFeature
- href="test.ecore#//UltimateContainer/all"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//NodeTargetC"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#DiagramLabelWithFont"/>
- <features
- href="test.ecore#//NodeTargetB/title"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- <children
- compartment="//@nodes.0/@ownedChild/@compartments.0">
- <containmentFeature
- href="test.ecore#//NodeTargetB/childrenOfB"/>
- <childrenFeature
- href="test.ecore#//NodeTargetB/childrenOfB"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//Child"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- <features
- href="test.ecore#//Child/childLabel"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#ColoredRectangleNode"/>
- <children
- compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@compartments.0"
- referencedChild="//@nodes.0/@ownedChild/@children.0/@ownedChild">
- <containmentFeature
- href="test.ecore#//Child/innerChildrenOfBChild"/>
- <childrenFeature
- href="test.ecore#//Child/innerChildrenOfBChild"/>
- </children>
- <compartments
- children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0">
- <compartment
- href="test.gmfgraph#Compartment_Title_Collapse"/>
- </compartments>
- </ownedChild>
- </children>
- <compartments
- children="//@nodes.0/@ownedChild/@children.0">
- <compartment
- href="test.gmfgraph#Compartment_NoTitle_No_Collapse"/>
- </compartments>
- </ownedChild>
- </nodes>
- <diagram>
- <diagramCanvas
- href="test.gmfgraph#Test-dd-canvas"/>
- <domainModel
- href="test.ecore#/"/>
- <domainMetaElement
- href="test.ecore#//UltimateContainer"/>
- <palette
- href="test.gmftool#//@palette"/>
- </diagram>
-</gmfmap:Mapping>
diff --git a/tests/org.eclipse.gmf.tests/models/tests/nodes_labels.gmfmap b/tests/org.eclipse.gmf.tests/models/tests/nodes_labels.gmfmap
deleted file mode 100644
index 186e455..0000000
--- a/tests/org.eclipse.gmf.tests/models/tests/nodes_labels.gmfmap
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<gmfmap:Mapping xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
- xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
- <nodes>
- <containmentFeature
- href="test.ecore#//UltimateContainer/all"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//NodeSrcA"/>
- <domainSpecialization
- body="true"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- <features
- href="test.ecore#//NodeSrcA/label"/>
- </labelMappings>
- <labelMappings
- xsi:type="gmfmap:ExpressionLabelMapping">
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- <viewExpression
- body="true"/>
- </labelMappings>
- <contextMenu
- href="test.gmftool#//@allMenus.1"/>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- <children>
- <containmentFeature
- href="test.ecore#//NodeSrcA/children1OfA"/>
- <childrenFeature
- href="test.ecore#//NodeSrcA/children1OfA"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//Child"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="test.gmfgraph#DiagramLabelWithFont"/>
- <features
- href="test.ecore#//Child/childLabel"/>
- </labelMappings>
- <labelMappings>
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- <children>
- <containmentFeature
- href="test.ecore#//Child/innerChildrenOfBChild"/>
- <childrenFeature
- href="test.ecore#//Child/innerChildrenOfBChild"/>
- <ownedChild>
- <domainMetaElement
- href="test.ecore#//Child"/>
- <domainSpecialization
- body="false"
- language="java"/>
- <labelMappings>
- <diagramLabel
- href="test.gmfgraph#TestLabel"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="test.gmftool#//@palette/@tools.0"/>
- <diagramNode
- href="test.gmfgraph#Test-dd-node"/>
- </ownedChild>
- </children>
- </ownedChild>
- </children>
- </ownedChild>
- </nodes>
- <diagram>
- <diagramCanvas
- href="test.gmfgraph#Test-dd-canvas"/>
- <domainModel
- href="test.ecore#/"/>
- <domainMetaElement
- href="test.ecore#//UltimateContainer"/>
- <palette
- href="test.gmftool#//@palette"/>
- <menuContributions
- href="test.gmftool#//@allMenus.0"/>
- </diagram>
-</gmfmap:Mapping>
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
index ddf1f61..556e6b5 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
@@ -83,11 +83,6 @@ import org.eclipse.gmf.tests.tr.QvtGenModelTransformerSimpleTest;
import org.eclipse.gmf.tests.tr.QvtGenModelTransformerVisualIDWithTraceTest;
import org.eclipse.gmf.tests.tr.QvtLabelMappingTransformTest;
import org.eclipse.gmf.tests.tr.QvtPaletteTransformationTest;
-import org.eclipse.gmf.tests.tr.QvtTransformComparisonAudtisTest;
-import org.eclipse.gmf.tests.tr.QvtTransformComparisonCompartmentRefNodeTest;
-import org.eclipse.gmf.tests.tr.QvtTransformComparisonFullTest;
-import org.eclipse.gmf.tests.tr.QvtTransformComparisonLinksTest;
-import org.eclipse.gmf.tests.tr.QvtTransformComparisonNodeLabelsTest;
import org.eclipse.gmf.tests.tr.QvtTransformModeledViewmapTest;
import org.eclipse.gmf.tests.tr.SimpleCompareTransformationEngineTest;
import org.eclipse.gmf.tests.tr.TestDefaultMergeService;
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareAbstractTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareAbstractTest.java
deleted file mode 100644
index 4a4f752..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareAbstractTest.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.codegen.gmfgen.Behaviour;
-import org.eclipse.gmf.codegen.gmfgen.ElementType;
-import org.eclipse.gmf.codegen.gmfgen.GenAuditContainer;
-import org.eclipse.gmf.codegen.gmfgen.GenAuditContext;
-import org.eclipse.gmf.codegen.gmfgen.GenAuditRoot;
-import org.eclipse.gmf.codegen.gmfgen.GenAuditRule;
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.gmf.codegen.gmfgen.GenContextMenu;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorView;
-import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
-import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
-import org.eclipse.gmf.codegen.gmfgen.GenNavigatorChildReference;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenParserImplementation;
-import org.eclipse.gmf.codegen.gmfgen.GenParsers;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.gmf.codegen.gmfgen.GenPropertySheet;
-import org.eclipse.gmf.codegen.gmfgen.GenPropertyTab;
-import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.Palette;
-import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
-import org.eclipse.gmf.codegen.gmfgen.ToolGroupItem;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-
-public abstract class QvtTransformCompareAbstractTest extends QvtTransformCompareTestSupport {
-
- public QvtTransformCompareAbstractTest(String name, String mapModel) {
- super( name,
- testFolder+"/test.ecore",
- testFolder+"/test.genmodel",
- testFolder+"/test.gmftool",
- testFolder+"/test.gmfgraph",
- mapModel );
- }
-
- protected GenEditorGenerator actualGenerator;
- protected GenEditorGenerator expectedGenerator;
-
- public void setUp() throws Exception {
- super.setUp();
- Transformation java = getJavaTransformation(false);
- expectedGenerator = java.execute();
- java.saveGenEditor("java");
- Transformation qvt = getQvtTransformation(false);
- actualGenerator = qvt.execute();
- qvt.saveGenEditor("qvt");
- }
-
- public void testGenAuditRoot() {
- GenAuditRoot expected = expectedGenerator.getAudits();
- GenAuditRoot actual = actualGenerator.getAudits();
-
- if (expected == null) {
- assertNull(actual);
- } else {
- assertNotNull(actual);
-
- checkObjectAttributes(expected, actual);
- doTestAuditRules(expected, actual);
- doTestAuditContainer(expected, actual);
- doTestAuditContext(expected, actual);
- }
- }
-
- public void testGenTopLevelNode() {
- GenDiagram expectedDiagram = expectedGenerator.getDiagram();
- GenDiagram actualDiagram = actualGenerator.getDiagram();
-
- assertNotNull(expectedDiagram);
- assertNotNull(actualDiagram);
-
- EList<GenTopLevelNode> expected = expectedDiagram.getTopLevelNodes();
- EList<GenTopLevelNode> actual = actualDiagram.getTopLevelNodes();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0;i<expected.size();i++) {
- GenTopLevelNode expectedNode = expected.get(i);
- GenTopLevelNode actualNode = actual.get(i);
-
- checkNodeAttributes(expectedNode, actualNode);
-
- assertEquals(expectedNode.getChildNodes().size(), actualNode.getChildNodes().size());
-
- doTestViewmap(expectedNode, actualNode);
- doTestLabels(expectedNode, actualNode);
- doTestModelFacet(expectedNode, actualNode);
- }
- }
-
- public void testGenChildNode() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenDiagram expectedDiagram = expectedGenEditor.getDiagram();
- GenDiagram actualDiagram = actualGenEditor.getDiagram();
-
- assertNotNull(expectedDiagram);
- assertNotNull(actualDiagram);
-
- EList<GenChildNode> expected = expectedDiagram.getChildNodes();
- EList<GenChildNode> actual = actualDiagram.getChildNodes();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0;i<expected.size();i++) {
- GenChildNode expectedNode = expected.get(i);
- GenChildNode actualNode = getChildNodeByVisualID(expectedNode.getVisualID(), actual);
- assertNotNull(actualNode);
-
- checkNodeAttributes(expectedNode, actualNode);
- checkObjectAttributes(expectedNode, actualNode);
-
- assertEquals(expectedNode.getAssistantNodes().size(), actualNode.getAssistantNodes().size());
-
- EList<Behaviour> expectedBehaviour = expectedNode.getBehaviour();
- EList<Behaviour> actualBehaviour = actualNode.getBehaviour();
-
- assertEquals(expectedBehaviour.size(), actualBehaviour.size());
-
- doTestViewmap(expectedNode, actualNode);
- doTestLabels(expectedNode, actualNode);
- doTestElementType(expectedNode, actualNode);
- doTestModelFacet(expectedNode, actualNode);
- }
- }
-
- public void testGenLink() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenDiagram expectedDiagram = expectedGenEditor.getDiagram();
- GenDiagram actualDiagram = actualGenEditor.getDiagram();
-
- assertNotNull(expectedDiagram);
- assertNotNull(actualDiagram);
-
- EList<GenLink> expected = expectedDiagram.getLinks();
- EList<GenLink> actual = actualDiagram.getLinks();
-
- assertEquals(expected.size(), actual.size());
-
- for (int i=0;i<expected.size();i++) {
- GenLink expLink = expected.get(i);
- GenLink actLink = expected.get(i);
- checkObjectAttributes(expLink, actLink);
-
- doTestElementType(expLink, actLink);
- doTestLabels(expLink, actLink);
- doTestModelFacet(expLink, actLink);
- }
- }
-
- public void testGenNavigator() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenNavigator baseNavigator = expectedGenEditor.getNavigator();
- GenNavigator qvtNavigator = actualGenEditor.getNavigator();
-
- checkObjectAttributes(baseNavigator, qvtNavigator);
- }
-
- public void testGenNavigatorChildReferences() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenNavigator expected = expectedGenEditor.getNavigator();
- GenNavigator actual = actualGenEditor.getNavigator();
-
- if (expected == null)
- assertNull(actual);
- else {
- assertNotNull(actual);
-
- assertTrue(expected.eResource().getContents().size() == 1);
- assertTrue(actual.eResource().getContents().size() == 1);
-
- EList<GenNavigatorChildReference> exp = expected.getChildReferences();
- EList<GenNavigatorChildReference> act = actual.getChildReferences();
-
- EList<GenNavigatorChildReference> found = new BasicEList<GenNavigatorChildReference>();
- assertEquals(exp.size(), act.size());
- for (int i=0; i<exp.size();i++) {
- GenNavigatorChildReference expRef = exp.get(i);
- GenNavigatorChildReference actualRef = findSameChildReference(expRef, act, found);
-
- assertNotNull(actualRef);
-
- if (!found.contains(actualRef)) {
- found.add(actualRef);
- checkObjectAttributes(expRef, actualRef);
- }
- }
- assertEquals(exp.size(), found.size());
- }
- }
-
- public void testGenPlugin() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenPlugin basePlugin = expectedGenEditor.getPlugin();
- GenPlugin qvtPlugin = actualGenEditor.getPlugin();
-
- checkObjectAttributes(basePlugin, qvtPlugin);
- checkContainedObjects(basePlugin, qvtPlugin);
- }
-
- public void testGenPropertySheet() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenPropertySheet basePropSheet = expectedGenEditor.getPropertySheet();
- GenPropertySheet qvtPropSheet = actualGenEditor.getPropertySheet();
-
- assertEquals(basePropSheet.getLabelProviderClassName(), qvtPropSheet.getLabelProviderClassName());
- assertEquals(basePropSheet.getLabelProviderQualifiedClassName(), qvtPropSheet.getLabelProviderQualifiedClassName());
-
- assertEquals(basePropSheet.getPackageName(), qvtPropSheet.getPackageName());
-
- checkObjectAttributes(basePropSheet, qvtPropSheet);
- checkContainedObjects(basePropSheet, qvtPropSheet);
- }
-
- public void testGenPropertySheetTabs() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenPropertySheet expected = expectedGenEditor.getPropertySheet();
- GenPropertySheet actual = actualGenEditor.getPropertySheet();
-
- if (expected == null)
- assertNull(actual);
- else {
- EList<GenPropertyTab> exp = expected.getTabs();
- EList<GenPropertyTab> act = actual.getTabs();
-
- assertEquals(exp.size(), act.size());
- for (int i=0; i<exp.size();i++) {
- checkObjectAttributes(exp.get(i), act.get(i));
- }
-
- checkContainedObjects(expected, actual);
- }
- }
-
- public void testGenDiagramPalette() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- Palette expected = expectedGenEditor.getDiagram().getPalette();
- Palette actual = actualGenEditor.getDiagram().getPalette();
-
- checkObjectAttributes(expected, actual);
- }
-
- public void testGenDiagramPaletteToolGroup() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- Palette basePalette = expectedGenEditor.getDiagram().getPalette();
- Palette qvtPalette = actualGenEditor.getDiagram().getPalette();
-
- if (basePalette == null) {
- assertNull(qvtPalette);
- } else {
- assertNotNull(qvtPalette);
-
- EList<ToolGroup> expected = basePalette.getGroups();
- EList<ToolGroup> actual = qvtPalette.getGroups();
-
- assertEquals(expected.size(), actual.size());
-
- for (int i=0;i<expected.size(); i++) {
- ToolGroup exp = expected.get(i);
- ToolGroup act = actual.get(i);
-
- checkObjectAttributes(exp, act);
-
- EList<ToolGroupItem> expItems = exp.getEntries();
- EList<ToolGroupItem> actItems = act.getEntries();
-
- assertEquals(expItems.size(), actItems.size());
-
- for (int j=0;j<expItems.size();j++) {
- checkObjectAttributes(expItems.get(i), actItems.get(i));
-
- }
- }
- }
- }
-
- public void testGenDiagramUpdater() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenDiagramUpdater baseUpdater = expectedGenEditor.getDiagramUpdater();
- GenDiagramUpdater qvtUpdater = actualGenEditor.getDiagramUpdater();
-
- checkObjectAttributes(baseUpdater, qvtUpdater);
- checkContainedObjects(baseUpdater, qvtUpdater);
- }
-
- public void testGenEditorView() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenEditorView baseEditor = expectedGenEditor.getEditor();
- GenEditorView qvtEditor = actualGenEditor.getEditor();
-
- checkObjectAttributes(baseEditor, qvtEditor);
-
- GenEditorGenerator baseEditorGen = baseEditor.getEditorGen();
- GenEditorGenerator qvtEditorGen = qvtEditor.getEditorGen();
-
- checkObjectAttributes(baseEditorGen, qvtEditorGen);
-
- // checkContainedObjects(baseEditorGen, qvtEditorGen);
- }
-
- public void testLabelGenParsers() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenParsers baseParser = expectedGenEditor.getLabelParsers();
- GenParsers qvtParser = actualGenEditor.getLabelParsers();
-
- checkObjectAttributes(baseParser, qvtParser);
-
- EList<GenParserImplementation> expected = baseParser.getImplementations();
- EList<GenParserImplementation> actual = qvtParser.getImplementations();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0;i<expected.size();i++) {
- GenParserImplementation expectImpl = expected.get(i);
- GenParserImplementation actualImpl = findParserImpl(expectImpl, actual);
- assertNotNull(actualImpl);
- checkObjectAttributes(expectImpl, actualImpl);
- }
- }
-
- public void testGenContextMenu() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- EList<GenContextMenu> baseContexts = expectedGenEditor.getContextMenus();
- EList<GenContextMenu> qvtContexts = actualGenEditor.getContextMenus();
-
- assertEquals(baseContexts.size(), qvtContexts.size());
-
- for (int i=0; i<baseContexts.size(); i++) {
- assertEquals(baseContexts.get(i).getID(), qvtContexts.get(i).getID());
-
- checkObjectAttributes(baseContexts.get(i), qvtContexts.get(i));
- checkContainedObjects(baseContexts.get(i), qvtContexts.get(i));
- }
- }
-
- public void testGenDiagramAttributes() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenDiagram baseDiagram = expectedGenEditor.getDiagram();
- GenDiagram qvtDiagram = actualGenEditor.getDiagram();
-
- checkObjectAttributes(baseDiagram, qvtDiagram);
- }
-
- public void testGenExpressionProviderContainer() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- GenExpressionProviderContainer baseExpr = expectedGenEditor.getExpressionProviders();
- GenExpressionProviderContainer qvtExpr = actualGenEditor.getExpressionProviders();
-
- if (baseExpr == null) {
- assertNull(qvtExpr);
- } else {
- assertNotNull(qvtExpr);
-
- checkObjectAttributes(baseExpr, qvtExpr);
-
- EList<GenExpressionProviderBase> expected = baseExpr.getProviders();
- EList<GenExpressionProviderBase> actual = baseExpr.getProviders();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0;i<expected.size();i++) {
- GenExpressionProviderBase exp = expected.get(i);
- GenExpressionProviderBase act = findGenExpressionProviderBase(exp, actual);
- assertNotNull(act);
- checkObjectAttributes(exp, act);
- }
- }
- }
-
- public void testGenCompartments() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- EList<GenCompartment> expected = expectedGenEditor.getDiagram().getCompartments();
- EList<GenCompartment> actual = actualGenEditor.getDiagram().getCompartments();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0; i<expected.size();i++) {
- checkObjectAttributes(expected.get(i), actual.get(i));
- checkContainedObjects(expected.get(i), actual.get(i));
- }
- }
-
- public void testGenDiagramBehaviour() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- EList<Behaviour> expected = expectedGenEditor.getDiagram().getBehaviour();
- EList<Behaviour> actual = actualGenEditor.getDiagram().getBehaviour();
-
- assertEquals(expected.size(), actual.size());
- for (int i=0; i<expected.size();i++) {
- checkObjectAttributes(expected.get(i), actual.get(i));
- checkContainedObjects(expected.get(i), actual.get(i));
- }
- }
-
- public void testGenDiagramAssistantNodes() {
- GenEditorGenerator expectedGenEditor = expectedGenerator;
- GenEditorGenerator actualGenEditor = actualGenerator;
-
- EList<GenNode> expected = expectedGenEditor.getDiagram().getAssistantNodes();
- EList<GenNode> actual = actualGenEditor.getDiagram().getAssistantNodes();
-
- assertEquals(expected.size(), actual.size());
-
- for (int i=0; i<expected.size();i++) {
- checkObjectAttributes(expected.get(i), actual.get(i));
- }
- }
-
- protected void doTestAuditRules(GenAuditRoot expected, GenAuditRoot actual) {
- EList<GenAuditRule> expR = expected.getRules();
- EList<GenAuditRule> actR = actual.getRules();
-
- assertEquals(expR.size(), actR.size());
- for (int i=0; i<expR.size(); i++) {
- GenAuditRule exp = expR.get(i);
- GenAuditRule act = actR.get(i);
-
- checkObjectAttributes(exp, act);
- }
- }
-
- protected void doTestAuditContext(GenAuditRoot expected, GenAuditRoot actual) {
- EList<GenAuditContext> expCtx = expected.getClientContexts();
- EList<GenAuditContext> actCtx = actual.getClientContexts();
-
- assertEquals(expCtx.size(), actCtx.size());
- for (int i=0;i<expCtx.size();i++) {
- GenAuditContext exp = expCtx.get(i);
- GenAuditContext act = findActualCtx(exp, actCtx);
- assertNotNull(act);
-
- checkObjectAttributes(exp, act);
- }
- }
-
- protected void doTestAuditContainer(GenAuditRoot expected, GenAuditRoot actual) {
- EList<GenAuditContainer> expCt = expected.getCategories();
- EList<GenAuditContainer> actCt = actual.getCategories();
-
- assertEquals(expCt.size(), actCt.size());
- for (int i=0;i<expCt.size();i++) {
- GenAuditContainer exp = expCt.get(i);
- GenAuditContainer act = actCt.get(i);
-
- checkObjectAttributes(exp, act);
- }
- }
-
- protected void doTestViewmap(GenCommonBase expectedNode, GenCommonBase actualNode) {
- if (expectedNode.getViewmap() == null)
- assertNull(actualNode.getViewmap());
- else {
- assertNotNull(actualNode.getViewmap());
- Viewmap expViewmap = expectedNode.getViewmap();
- Viewmap actViewmap = actualNode.getViewmap();
-
- assertEquals(expViewmap.getRequiredPluginIDs(), actViewmap.getRequiredPluginIDs());
- checkObjectAttributes(expViewmap, actViewmap);
- }
- }
-
- protected void doTestLabels(GenNode expectedNode, GenNode actualNode) {
- assertEquals(expectedNode.getLabels().size(), actualNode.getLabels().size());
-
- for (int j=0;j<expectedNode.getLabels().size(); j++) {
- GenNodeLabel expectedLabel = expectedNode.getLabels().get(j);
- GenNodeLabel actualLabel = actualNode.getLabels().get(j);
-
- assertEquals(expectedLabel.getVisualID(), actualLabel.getVisualID());
-
- LabelModelFacet expFacet = expectedLabel.getModelFacet();
- LabelModelFacet actFacet = expectedLabel.getModelFacet();
-
- assertEquals(expFacet.eContainingFeature(), actFacet.eContainingFeature());
-
- checkObjectAttributes(expectedLabel, actualLabel);
-
- doTestViewmap(expectedLabel, actualLabel);
- }
- }
-
- protected void doTestModelFacet(GenNode expected, GenNode actual) {
- TypeModelFacet expFacet = expected.getModelFacet();
- TypeModelFacet actFacet = actual.getModelFacet();
-
- assertEquals(expFacet.getChildMetaFeature().getName(), actFacet.getChildMetaFeature().getName());
- assertEquals(expFacet.eContainingFeature().getName(), actFacet.eContainingFeature().getName());
- assertEquals(expFacet.getContainmentMetaFeature().getName(), actFacet.getContainmentMetaFeature().getName());
- }
-
- protected void doTestModelFacet(GenLink expected, GenLink actual) {
- LinkModelFacet expFacet = expected.getModelFacet();
- LinkModelFacet actFacet = actual.getModelFacet();
- checkObjectAttributes(expFacet, actFacet);
- assertEquals(expFacet.getSourceType(), actFacet.getSourceType());
- assertEquals(expFacet.eContainingFeature(), actFacet.eContainingFeature());
- assertEquals(expFacet.getTargetType(), actFacet.getTargetType());
- }
-
- protected void doTestLabels(GenLink expected, GenLink actual) {
- EList<GenLinkLabel> expLabels = expected.getLabels();
- EList<GenLinkLabel> actLabels = actual.getLabels();
- assertEquals(expLabels.size(), actLabels.size());
-
- for (int i=0;i<expLabels.size(); i++) {
- GenLinkLabel expL = expLabels.get(i);
- GenLinkLabel actL = actLabels.get(i);
-
- checkObjectAttributes(expL, actL);
- }
- }
-
- protected void checkNodeAttributes(GenNode expectedNode, GenNode actualNode) {
- assertEquals(expectedNode.getVisualID(), actualNode.getVisualID());
- assertEquals(expectedNode.getUniqueIdentifier(), actualNode.getUniqueIdentifier());
-
- assertEquals(expectedNode.getClassNamePrefix(), actualNode.getClassNamePrefix());
- assertEquals(expectedNode.getClassNameSuffux(), actualNode.getClassNameSuffux());
-
- assertEquals(expectedNode.getCanonicalEditPolicyClassName(), actualNode.getCanonicalEditPolicyClassName());
- assertEquals(expectedNode.getCanonicalEditPolicyQualifiedClassName(), actualNode.getCanonicalEditPolicyQualifiedClassName());
-
- assertEquals(expectedNode.getCreateCommandClassName(), actualNode.getCreateCommandClassName());
- assertEquals(expectedNode.getCreateCommandQualifiedClassName(), actualNode.getCreateCommandQualifiedClassName());
- assertEquals(expectedNode.getEditPartClassName(), actualNode.getEditPartClassName());
- assertEquals(expectedNode.getEditPartQualifiedClassName(), actualNode.getEditPartQualifiedClassName());
- assertEquals(expectedNode.getGraphicalNodeEditPolicyClassName(), actualNode.getGraphicalNodeEditPolicyClassName());
- assertEquals(expectedNode.getGraphicalNodeEditPolicyQualifiedClassName(), actualNode.getGraphicalNodeEditPolicyQualifiedClassName());
- assertEquals(expectedNode.getItemSemanticEditPolicyClassName(), actualNode.getItemSemanticEditPolicyClassName());
- assertEquals(expectedNode.getItemSemanticEditPolicyQualifiedClassName(), actualNode.getItemSemanticEditPolicyQualifiedClassName());
- assertEquals(expectedNode.getNotationViewFactoryClassName(), actualNode.getNotationViewFactoryClassName());
- assertEquals(expectedNode.getNotationViewFactoryQualifiedClassName(), actualNode.getNotationViewFactoryQualifiedClassName());
- assertEquals(expectedNode.getPrimaryDragEditPolicyQualifiedClassName(), actualNode.getPrimaryDragEditPolicyQualifiedClassName());
- }
-
- protected void doTestElementType(GenCommonBase expectedNode, GenCommonBase actualNode) {
- ElementType expectedType = expectedNode.getElementType();
- ElementType actualType = actualNode.getElementType();
-
- assertEquals(expectedType.getDisplayName(), actualType.getDisplayName());
- assertEquals(expectedType.getUniqueIdentifier(), actualType.getUniqueIdentifier());
- assertEquals(expectedType.getDiagramElement().getUniqueIdentifier(), actualType.getDiagramElement().getUniqueIdentifier());
- }
-
-}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareTestSupport.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareTestSupport.java
deleted file mode 100644
index b9b8ab7..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformCompareTestSupport.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Montages A.G.
- * 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:
- * Guillaume Hillairet (Montages A.G.) : initial implementation
- *******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.gmf.codegen.gmfgen.GenAuditContext;
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
-import org.eclipse.gmf.codegen.gmfgen.GenNavigatorChildReference;
-import org.eclipse.gmf.codegen.gmfgen.GenParserImplementation;
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
-import org.eclipse.gmf.gmfgraph.Canvas;
-import org.eclipse.gmf.graphdef.codegen.MapModeCodeGenStrategy;
-import org.eclipse.gmf.internal.bridge.StatefulVisualIdentifierDispencer;
-import org.eclipse.gmf.internal.bridge.genmodel.BasicDiagramRunTimeModelHelper;
-import org.eclipse.gmf.internal.bridge.genmodel.DiagramGenModelTransformer;
-import org.eclipse.gmf.internal.bridge.genmodel.DiagramRunTimeModelHelper;
-import org.eclipse.gmf.internal.bridge.genmodel.GenModelProducer;
-import org.eclipse.gmf.internal.bridge.genmodel.InnerClassViewmapProducer;
-import org.eclipse.gmf.internal.bridge.genmodel.ModeledViewmapProducer;
-import org.eclipse.gmf.internal.bridge.genmodel.QVTDiagramGenModelTransformer;
-import org.eclipse.gmf.internal.bridge.genmodel.ViewmapProducer;
-import org.eclipse.gmf.internal.bridge.transform.GenModelDetector;
-import org.eclipse.gmf.internal.bridge.transform.TransformToGenModelOperation;
-import org.eclipse.gmf.internal.bridge.transform.VisualIdentifierDispenserProvider;
-import org.eclipse.gmf.internal.common.URIUtil;
-import org.eclipse.gmf.mappings.Mapping;
-import org.eclipse.gmf.tests.ConfiguredTestCase;
-import org.eclipse.m2m.qvt.oml.BasicModelExtent;
-import org.eclipse.m2m.qvt.oml.ExecutionContextImpl;
-import org.eclipse.m2m.qvt.oml.ExecutionDiagnostic;
-
-public abstract class QvtTransformCompareTestSupport extends ConfiguredTestCase {
-
- protected static String FOLDER_MODELS = "models"; //$NON-NLS-1$
- protected static String FILE_BASE = "test"; //$NON-NLS-1$
- protected static String FILE_EXT_ECORE = "ecore"; //$NON-NLS-1$
- protected static String FILE_EXT_GMFGEN = "gmfgen"; //$NON-NLS-1$
- protected static String FILE_EXT_GMFGRAPH = "gmfgraph"; //$NON-NLS-1$
- protected static String FILE_EXT_GMFMAP = "gmfmap"; //$NON-NLS-1$
- protected static String FILE_EXT_GMFTOOL = "gmftool"; //$NON-NLS-1$
-
- protected IProject myProject;
-
- protected static String testFolder = "platform:/plugin/org.eclipse.gmf.tests/models/tests"; //$NON-NLS-1$
-
- protected String emf_model_uri;
- protected String gen_model_uri;
- protected String tool_model_uri;
- protected String graph_model_uri;
- protected String map_model_uri;
-
- protected final ResourceSet resourceSet = new ResourceSetImpl();
- protected Mapping mapping;
- private GenModel genModel;
-
- protected URI traceURI;
- protected VisualIdentifierDispenserProvider provider;
- private Canvas canvas;
-
- public QvtTransformCompareTestSupport(String name, String ecoreFile, String genFile, String toolFile, String graphFile, String mapFile) {
- super(name);
- emf_model_uri = ecoreFile;
- gen_model_uri = genFile;
- tool_model_uri = toolFile;
- graph_model_uri = graphFile;
- map_model_uri = mapFile;
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- myProject = createProject();
- this.traceURI = URI.createURI(myProject.getFile("test.trace").getFullPath().toString());
- prepareResources();
- this.genModel = loadGenModel();
- this.canvas = loadCanvas();
- this.mapping = loadMapping();
-
- provider = new VisualIdentifierDispenserProvider(traceURI);
- provider.acquire();
- }
-
- @Override
- protected void tearDown() throws Exception {
- deleteProject();
- myProject = null;
- super.tearDown();
- }
-
- protected Mapping loadMapping() {
- Resource map = resourceSet.createResource(URI.createURI(map_model_uri));
- try {
- map.load(null);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- assertEquals(1, map.getContents().size());
- EObject root = map.getContents().get(0);
- assertTrue(root instanceof Mapping);
-
- return (Mapping) root;
- }
-
- protected Mapping getMapping() {
- return mapping;
- }
-
- protected Canvas loadCanvas() {
- Resource graph = resourceSet.createResource(URI.createURI(graph_model_uri));
- try {
- graph.load(null);
- } catch (IOException e) {
- e.printStackTrace();
- }
- assertEquals(1, graph.getContents().size());
- EObject root = graph.getContents().get(0);
- assertTrue(root instanceof Canvas);
-
- return (Canvas) root;
- }
-
- protected Canvas getCanvas() {
- return canvas;
- }
-
- protected GenModel loadGenModel() {
- Resource gen = resourceSet.createResource(URI.createURI(this.gen_model_uri));
- try {
- gen.load(null);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- assertEquals(1, gen.getContents().size());
- EObject root = gen.getContents().get(0);
- assertTrue(root instanceof GenModel);
-
- return (GenModel) root;
- }
-
- protected GenModel getGenModel() {
- return this.genModel;
- }
-
- protected void prepareResources() throws IOException {
- Resource emf = resourceSet.createResource(URI.createURI(emf_model_uri));
- emf.load(null);
- Resource tool = resourceSet.createResource(URI.createURI(tool_model_uri));
- tool.load(null);
- Resource graph = resourceSet.createResource(URI.createURI(graph_model_uri));
- graph.load(null);
- Resource map = resourceSet.createResource(URI.createURI(map_model_uri));
- map.load(null);
- }
-
- protected abstract class Transformation {
- protected GenEditorGenerator editor;
- protected StatefulVisualIdentifierDispencer dispenser;
- public GenEditorGenerator getEditor() {
- return editor;
- }
- public abstract GenEditorGenerator execute();
- public StatefulVisualIdentifierDispencer getDispencer() {return dispenser;}
- public void saveGenEditor(String type) {
- GenEditorGenerator editor = getEditor();
- Resource resource = resourceSet.createResource(traceURI.trimFileExtension().appendFileExtension(type+".gmfgen"));
- resource.getContents().add(editor);
- try {
- resource.save(null);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- protected Transformation getJavaTransformation(final boolean useModeledViewmap) {
- return new Transformation() {
- @Override
- public GenEditorGenerator execute() {
- VisualIdentifierDispenserProvider provider = new VisualIdentifierDispenserProvider(
- traceURI.trimFileExtension().appendFileExtension("java.gmfgen"));
- provider.acquire();
- dispenser = (StatefulVisualIdentifierDispencer) provider.get();
- GenModelProducer producer = getJavaGenModelProducer(useModeledViewmap, getGenModel(), provider);
- try {
- editor = producer.process(getMapping(), null);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return editor;
- }
- };
- }
-
- protected Transformation getQvtTransformation(final boolean useModeledViewmap) {
- return new Transformation() {
- @Override
- public GenEditorGenerator execute() {
- VisualIdentifierDispenserProvider provider = new VisualIdentifierDispenserProvider(
- traceURI.trimFileExtension().appendFileExtension("qvt.gmfgen"));
- provider.acquire();
- dispenser = (StatefulVisualIdentifierDispencer) provider.get();
- GenModelProducer producer = getQvtGenModelProducer(useModeledViewmap, getGenModel(), provider);
- try {
- editor = producer.process(getMapping(), null);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return editor;
- }
- };
- }
-
- protected GenModelProducer getJavaGenModelProducer(boolean useModeledViewmap, final GenModel genModel, VisualIdentifierDispenserProvider idDespenser) {
- MapModeCodeGenStrategy mmStrategy = MapModeCodeGenStrategy.DYNAMIC;
- ViewmapProducer viewmapProducer = useModeledViewmap ? new ModeledViewmapProducer() : new InnerClassViewmapProducer("full", mmStrategy, null);
-
- final DiagramRunTimeModelHelper drtModelHelper = new BasicDiagramRunTimeModelHelper();
- DiagramGenModelTransformer.Parameters opts = new DiagramGenModelTransformer.Parameters(
- drtModelHelper, viewmapProducer, idDespenser.get(), false);
- final DiagramGenModelTransformer t = new DiagramGenModelTransformer(opts);
-
- t.setEMFGenModel(genModel);
-
- return new GenModelProducer() {
-
- public GenEditorGenerator process(Mapping mapping, IProgressMonitor progress) {
- t.transform(mapping);
- return t.getResult();
- }
- };
- }
-
- protected GenModelProducer getQvtGenModelProducer(boolean useModeledViewmap, final GenModel genModel, VisualIdentifierDispenserProvider idDespenser) {
- final ExecutionContextImpl context = new ExecutionContextImpl();
- context.setConfigProperty("rcp", false);
- context.setConfigProperty("useMapMode", false);
- context.setConfigProperty("useFullRunTime", false);
- context.setConfigProperty("useInTransformationCodeGen", !useModeledViewmap);
-
- final QVTDiagramGenModelTransformer transformer = new QVTDiagramGenModelTransformer(resourceSet, idDespenser.get());
-
- return new GenModelProducer() {
- public GenEditorGenerator process(Mapping mapping, IProgressMonitor progress) throws CoreException {
- final BasicModelExtent output = new BasicModelExtent();
- final ExecutionDiagnostic result = transformer.transform(mapping, genModel, output, context);
-
- if(result.getSeverity() == Diagnostic.OK) {
- List<EObject> outObjects = output.getContents();
- return outObjects.get(0) instanceof GenEditorGenerator ? (GenEditorGenerator) outObjects.get(0) : null;
- }
- return null;
- }
- };
- }
-
- protected void deleteProject() throws CoreException {
- if (getProject() != null) {
- if (getProject().isOpen()) {
- getProject().close(new NullProgressMonitor());
- }
- if (getProject().exists()) {
- getProject().delete(true, new NullProgressMonitor());
- }
- }
- }
-
- protected IProject getProject() {
- return myProject;
- }
-
- protected IProject createProject() {
- String projectName = "TransformToGenModelOperationTest_" + String.valueOf(System.currentTimeMillis()); //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- assertFalse("Project with this name already present in the workspace: " + projectName, project.exists());
- try {
- project.create(new NullProgressMonitor());
- project.open(new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
- assertTrue("Project was not created: " + projectName, project.exists());
- return project;
- }
-
- protected void loadMappingModel(URI mapURI, TransformToGenModelOperation myOperation) {
- Mapping mapping = null;
- try {
- mapping = myOperation.loadMappingModel(mapURI, null);
- assertNotNull("Mapping should be resolved", mapping);
- Diagnostic validationResult = myOperation.getMapmodelValidationResult();
- assertNotNull("MappingModel validation result should be set", validationResult);
- assertFalse("MappingModel validation result should differ from CANCEL value", IStatus.CANCEL == validationResult.getSeverity());
- assertFalse("MappingModel validation result should differ from ERROR value", IStatus.ERROR == validationResult.getSeverity());
- assertNotNull("GenModelDetector should be initialized", myOperation.getGenModelDetector());
- assertNull("GenModel should be reset", myOperation.getGenModel());
- } catch (CoreException e) {
- fail(e.getStatus().getMessage());
- }
- }
-
- protected URI createDefaultGenModel(URI mapURI, TransformToGenModelOperation myOperation) {
- URI genmodelURI = null;
- try {
- GenModelDetector gmd = myOperation.getGenModelDetector();
- assertNotNull("GenModelDetector should be initialized", gmd);
- genmodelURI = gmd.createDefault(getProject().getName(), URIUtil.getFile(mapURI));
- assertNotNull("GenModel URI should be created", genmodelURI);
-
- IFile file = URIUtil.getFile(mapURI);
- assertNotNull("GenModel file should be created", file);
- assertTrue("GenModel file should exists", file.exists());
- } catch (CoreException e) {
- fail("Failed to create default GenModel: " + e.getMessage());
- }
- return genmodelURI;
- }
-
- protected URI prepareResources(String baseURI) throws IOException {
- ResourceSet rs = new ResourceSetImpl();
- Resource emf = rs.createResource(URI.createURI(baseURI+".ecore"));
- emf.load(null);
- Resource tool = rs.createResource(URI.createURI(baseURI+".gmftool"));
- tool.load(null);
- Resource graph = rs.createResource(URI.createURI(baseURI+".gmfgraph"));
- graph.load(null);
- Resource map = rs.createResource(URI.createURI(baseURI+".gmfmap"));
- map.load(null);
-
- return URI.createURI(baseURI+".gmfmap");
- }
-
- protected URI createURI(String extension) {
- String pathName = getProject().getName() +
- IPath.SEPARATOR + FOLDER_MODELS +
- IPath.SEPARATOR + FILE_BASE + "." + extension; //$NON-NLS-1$
- URI uri = URI.createPlatformResourceURI(pathName, true);
- return uri;
- }
-
- protected GenChildNode getChildNodeByVisualID(int visualID, EList<GenChildNode> child) {
- for (GenChildNode node: child) {
- if (visualID == node.getVisualID()) {
- return node;
- }
- }
- return null;
- }
-
- protected void checkObjectAttributes(EObject expected, EObject actual) {
- if (expected == null) {
- assertNull(actual);
- return;
- }
-
- assertNotNull(actual);
-
- for (EAttribute attr: expected.eClass().getEAllAttributes()) {
- if (expected.eIsSet(attr)) {
-
- assertTrue("attribute "+expected.eClass().getName()+"."+attr.getName()+" should be set", actual.eIsSet(attr));
-
- if (attr.isMany()) {
- List<?> exp = (List<?>) expected.eGet(attr);
- List<?> act = (List<?>) actual.eGet(attr);
- assertEquals(exp.size(), act.size());
-
- System.out.println(exp);
- System.out.println(act);
- for (int i=0; i<exp.size(); i++) {
- assertEquals(exp.get(i), act.get(i));
-// assertTrue(act.contains(exp.get(i)));
- }
- } else {
- assertEquals(expected.eClass().getName()+" attribute: "+attr.getName(), expected.eGet(attr), actual.eGet(attr));
- }
-
- } else {
- assertFalse("attribute "+attr.getName()+" should not be set", actual.eIsSet(attr));
- }
- }
- }
-
- protected void checkContainedObjects(EObject expected, EObject actual) {
- if (expected == null) {
- assertNull(actual);
- return;
- }
-
- assertNotNull(actual);
-
- for (EReference ref: expected.eClass().getEAllReferences()) {
- if (ref.isMany()) {
- @SuppressWarnings("unchecked")
- EList<EObject> expectedObjects = (EList<EObject>) expected.eGet(ref);
- @SuppressWarnings("unchecked")
- EList<EObject> actualObjects = (EList<EObject>) actual.eGet(ref);
-
- assertEquals(expected.eClass().getName()+" number of elements in: " + ref.getName(), expectedObjects.size(), actualObjects.size());
-
- for (int i=0;i<expectedObjects.size();i++) {
- if (ref.isContainment()) {
- checkObjectAttributes(expectedObjects.get(i), actualObjects.get(i));
- checkContainedObjects(expectedObjects.get(i), actualObjects.get(i));
- }
- }
- } else {
- EObject exp = (EObject) expected.eGet(ref);
- EObject act = (EObject) actual.eGet(ref);
-
- if (ref.isContainment()) {
- checkObjectAttributes(exp, act);
- checkContainedObjects(exp, act);
- }
- }
- }
- }
-
- protected GenExpressionProviderBase findGenExpressionProviderBase(GenExpressionProviderBase exp, EList<GenExpressionProviderBase> actuals) {
- for (GenExpressionProviderBase actual: actuals) {
- if (checkValueExpressions(exp.getExpressions(), actual.getExpressions()))
- return actual;
- }
- return null;
- }
-
- protected ValueExpression findValueExpression(ValueExpression expected, EList<ValueExpression> actuals) {
- for (ValueExpression actual: actuals) {
- if (actual.getBody().equals(expected.getBody()) && actual.getBodyString().equals(expected.getBodyString())) {
- return actual;
- }
- }
- return null;
- }
-
- protected boolean checkValueExpressions(EList<ValueExpression> expected, EList<ValueExpression> actual) {
- if (expected.size() == actual.size()) {
- boolean find = true;
- for (int i=0;i<expected.size();i++) {
- ValueExpression exp = expected.get(i);
- ValueExpression found = findValueExpression(exp, actual);
- find = find && found != null;
- }
- return find;
- }
- return false;
- }
-
- protected GenNavigatorChildReference findSameChildReference(GenNavigatorChildReference expected, EList<GenNavigatorChildReference> actuals, EList<GenNavigatorChildReference> found) {
- for (GenNavigatorChildReference actual: actuals) {
-
- if (expected.getChild().getVisualID() == actual.getChild().getVisualID()) {
-
- if (expected.getParent() == null) {
- assertNull(actual.getParent());
- if (!found.contains(actual))
- return actual;
- } else {
- assertNotNull(actual.getParent());
- if (actual.getParent().getVisualID() == expected.getParent().getVisualID()) {
- if (!found.contains(actual))
- return actual;
- }
- }
- }
- }
- return null;
- }
-
- protected GenAuditContext findActualCtx(GenAuditContext expected, EList<GenAuditContext> actuals) {
- for (GenAuditContext actual: actuals) {
- if (actual.getId().equals(expected.getId())) {
- return actual;
- }
- }
- return null;
- }
-
- protected GenParserImplementation findParserImpl(GenParserImplementation expectImpl, EList<GenParserImplementation> actuals) {
- for (GenParserImplementation actual: actuals) {
- if (actual.eClass().equals(expectImpl.eClass())) {
- boolean res = true;
- for (LabelModelFacet facet: expectImpl.getUses()) {
- res = res && findLabelModelFacet(facet, actual.getUses());
- }
- if (res)
- return actual;
- }
- }
- return null;
- }
-
- private boolean findLabelModelFacet(LabelModelFacet facet, EList<LabelModelFacet> uses) {
- GenCommonBase expected = (GenCommonBase)facet.eContainer();
-
- if (uses.isEmpty()) return false;
- for (LabelModelFacet f: uses) {
- if (f.eContainer() instanceof GenCommonBase) {
- if ( ((GenCommonBase)f.eContainer()).getVisualID() == expected.getVisualID() )
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonAudtisTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonAudtisTest.java
deleted file mode 100644
index cddf789..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonAudtisTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-public class QvtTransformComparisonAudtisTest extends QvtTransformCompareAbstractTest {
-
- public QvtTransformComparisonAudtisTest(String name) {
- super(name, testFolder+"/audits.gmfmap");
- }
-
-}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonCompartmentRefNodeTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonCompartmentRefNodeTest.java
deleted file mode 100644
index d7289ea..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonCompartmentRefNodeTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-public class QvtTransformComparisonCompartmentRefNodeTest extends QvtTransformCompareAbstractTest {
-
- public QvtTransformComparisonCompartmentRefNodeTest(String name) {
- super(name, testFolder+"/compartments_ref_node.gmfmap");
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonFullTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonFullTest.java
deleted file mode 100644
index 154cee5..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonFullTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-public class QvtTransformComparisonFullTest extends QvtTransformCompareAbstractTest {
-
- public QvtTransformComparisonFullTest(String name) {
- super(name, testFolder+"/test.gmfmap");
- }
-
-}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonLinksTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonLinksTest.java
deleted file mode 100644
index a76e30c..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonLinksTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-public class QvtTransformComparisonLinksTest extends QvtTransformCompareAbstractTest {
-
- public QvtTransformComparisonLinksTest(String name) {
- super(name, testFolder+"/links.gmfmap");
- }
-
-}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonNodeLabelsTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonNodeLabelsTest.java
deleted file mode 100644
index a4bb0a5..0000000
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformComparisonNodeLabelsTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
-package org.eclipse.gmf.tests.tr;
-
-public class QvtTransformComparisonNodeLabelsTest extends QvtTransformCompareAbstractTest {
-
- public QvtTransformComparisonNodeLabelsTest(String name) {
- super(name, testFolder+"/nodes_labels.gmfmap");
- }
-
-}