diff options
author | Camille Letavernier | 2014-01-31 16:14:55 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-01-31 16:14:55 +0000 |
commit | fe571c418018513e586bef75f0ca51fe21ac23cd (patch) | |
tree | 4dfbbeaf54f43a983e8853f449b551136952efa3 /tests | |
parent | 87a380b7deb824c8f034a4ab2313a796374ef76d (diff) | |
parent | 1eaaf3cec9afacfc9413be01455bf0cedc98efb1 (diff) | |
download | org.eclipse.papyrus-fe571c418018513e586bef75f0ca51fe21ac23cd.tar.gz org.eclipse.papyrus-fe571c418018513e586bef75f0ca51fe21ac23cd.tar.xz org.eclipse.papyrus-fe571c418018513e586bef75f0ca51fe21ac23cd.zip |
Synchronize with master
Conflicts:
tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
Diffstat (limited to 'tests')
43 files changed, 3935 insertions, 2480 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF index e26293a32f0..9906a3b4c21 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF @@ -42,6 +42,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.sequence.tests;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.interactionoverview.tests;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.composite.tests;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.css.tests;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java index 5b786c77510..f9dc589e01e 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java @@ -84,6 +84,7 @@ public class AllTests { suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.component.test.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.timing.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.usecase.tests.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.composite.test.AllTests.class));
//suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.sequence.tests.AllTests.class)); //Disabled. They currently do not run on Hudson
// suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.interactionoverview.tests.AllTests.class)); //Disabled. They currently do not run on Hudson
//
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java index 342ceb4d0ed..90dba9fc01c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java @@ -1,261 +1,261 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView;
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for link creation test (via palette tools).
- */
-public class AbstractLinkPrepareTest extends AbstractTest {
-
- public static String toolID;
-
- // Custom nodes
- public static View blockSourceView, blockTargetView;
-
- // Custom child label nodes
- public static View actorPartSourceView, actorPartTargetView;
- public static View nestedActorPartSourceView, nestedActorPartTargetView;
- public static View portOnBlockSourceView, portOnBlockTargetView;
- public static View portOnPartSourceView, portOnPartTargetView;
- public static View portOnNestedPartSourceView, portOnNestedPartTargetView;
- public static View flowportOnBlockSourceView, flowportOnBlockTargetView;
- public static View flowportOnPartSourceView, flowportOnPartTargetView;
- public static View flowportOnNestedPartSourceView, flowportOnNestedPartTargetView;
- public static View partSourceView, partTargetView;
- public static View nestedPartSourceView, nestedPartTargetView;
- public static View propertySourceView, propertyTargetView;
- public static View nestedPropertySourceView, nestedPropertyTargetView;
- public static View referenceSourceView, referenceTargetView;
- public static View nestedReferenceSourceView, nestedReferenceTargetView;
- public static View valueSourceView, valueTargetView;
- public static View nestedValueSourceView, nestedValueTargetView;
-
- // Inherited nodes
- public static View commentSourceView, commentTargetView, commentCNSourceView, commentCNTargetView;
- public static View constraintSourceView, constraintTargetView, constraintCNSourceView, constraintCNTargetView;
-
- public static View partContainer1; // Its type block may be set encapsulated for testing purpose.
- public static View partContainer2; // Its type block may be set encapsulated for testing purpose.
-
- public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
-
- public static View subNestedActorPartContainer1_1_1SourceView;
-
- public static View subNestedActorPartContainer1_1_1TargetView;
-
- public static View portOnSubNestedPartSourceView;
-
- public static View portOnSubNestedPartTargetView;
-
- public static View flowportOnSubNestedPartSourceView;
-
- public static View flowportOnSubNestedPartTargetView;
-
- public static View portOnSubNestedPartContainer1_1_1SourceView;
-
- public static View portOnSubNestedPartContainer2_1_1TargetView;
-
- public static View portOnSubNestedPartContainer1_1_2TargetView;
-
- public static View flowportOnSubNestedPartContainer1_1_1SourceView;
-
- public static View flowportOnSubNestedPartContainer2_1_1TargetView;
-
- public static View portOnSubNestedPartContainer2SourceView;
-
- public static View portOnSubNestedPartContainer1_2_1TargetView;
-
- public static View flowportOnSubNestedPartContainer1_2_1TargetView;
-
- public static View flowportOnSubNestedPartContainer1_1_2TargetView;
-
- public static View subNestedPartContainer1_1_1SourceView;
-
- public static View subNestedPartContainer1_2_1TargetView;
-
- public static View subNestedPartContainer1_1_1TargetView;
-
- public static View subNestedPartContainer1_1_2TargetView;
-
- public static View subNestedPropertyContainer1_1_1SourceView;
-
- public static View subNestedPropertyContainer1_1_1TargetView;
-
- public static View subNestedPropertyContainer1_2_1TargetView;
-
- public static View subNestedPropertyContainer1_1_2TargetView;
-
- public static View subNestedReferenceContainer1_1_1SourceView;
-
- public static View subNestedReferenceContainer1_1_1TargetView;
-
- public static View subNestedReferenceContainer1_2_1TargetView;
-
- public static View subNestedReferenceContainer1_1_2TargetView;
-
- public static View subNestedValueContainer1_1_1SourceView;
-
- public static View subNestedValueContainer1_1_1TargetView, subNestedValueContainer1_2_1TargetView, subNestedValueContainer1_1_2TargetView;
-
- public static View subNestedActorPartContainer1_2_1TargetView;
-
- public static View subNestedActorPartContainer1_1_2TargetView;
-
- public static View nestedPartContainer1_1;
-
- public static View nestedPartContainer2_1;
-
- public static View nestedPartContainer1_2;
-
- @BeforeClass
- public static void prepareInheritedNodes() throws Exception {
- View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View containerCpt = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
-
- // Prepare elements for link creation tests
- commentSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
- commentTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
- commentCNSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt);
- commentCNTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt);
-
- constraintSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
- constraintTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
- constraintCNSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt);
- constraintCNTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt);
- }
-
- @BeforeClass
- public static void prepareCustomNodes() throws Exception {
- View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View blockStructureView = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
- // part in block (level = 1)
- partContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View partContainer1StructureView = ViewUtil.getChildBySemanticHint(partContainer1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- partContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View partContainer2StructureView = ViewUtil.getChildBySemanticHint(partContainer2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
-
- nestedPartContainer1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- View nestedPartContainer1_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- nestedPartContainer2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- View nestedPartContainer2_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer2_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- nestedPartContainer1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer2StructureView);
- View nestedPartContainer1_2StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // nested container in nested part (level = 3)
- View subNestedPartContainer1_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView);
- View subNestedPartContainer2_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView);
-
- // nested container in nestedPartContainer2_1 (level = 3)
- View subNestedPartContainer1_2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1StructureView);
-
- // nested container in nestedPartContainer1_2StructureView (level = 3)
- View subNestedPartContainer1_1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2StructureView);
-
-
- // Prepare elements for link creation tests
-
- blockSourceView = container;
- blockTargetView = container;
-
- // Prepare child nodes
-
- partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPartSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedPartTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- // Port & FlowPorts no distinction made on FlowPorts kind...
- portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container);
- portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container);
- portOnPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer1);
- portOnPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer2);
- portOnNestedPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer1_1);
- portOnNestedPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer2_1);
- portOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView);
- portOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1);
- portOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1);
- portOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2);
-
- flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container);
- flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container);
- flowportOnPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer1);
- flowportOnPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer2);
- flowportOnNestedPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer1_1);
- flowportOnNestedPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer2_1);
- flowportOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView);
- flowportOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1);
- flowportOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1);
- flowportOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2);
-
- propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedPropertyContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPropertyContainer1_1_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPropertyContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedPropertyContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedReferenceContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedReferenceContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedReferenceContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedReferenceContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
-
- valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedValueContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedValueContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedValueContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedValueContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- actorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedActorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedActorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedActorPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedActorPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedActorPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedActorPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
- }
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView; +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; +import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.BeforeClass; + +/** + * JUnit tests for link creation test (via palette tools). + */ +public abstract class AbstractLinkPrepareTest extends AbstractTest { + + public static String toolID; + + // Custom nodes + public static View blockSourceView, blockTargetView; + + // Custom child label nodes + public static View actorPartSourceView, actorPartTargetView; + public static View nestedActorPartSourceView, nestedActorPartTargetView; + public static View portOnBlockSourceView, portOnBlockTargetView; + public static View portOnPartSourceView, portOnPartTargetView; + public static View portOnNestedPartSourceView, portOnNestedPartTargetView; + public static View flowportOnBlockSourceView, flowportOnBlockTargetView; + public static View flowportOnPartSourceView, flowportOnPartTargetView; + public static View flowportOnNestedPartSourceView, flowportOnNestedPartTargetView; + public static View partSourceView, partTargetView; + public static View nestedPartSourceView, nestedPartTargetView; + public static View propertySourceView, propertyTargetView; + public static View nestedPropertySourceView, nestedPropertyTargetView; + public static View referenceSourceView, referenceTargetView; + public static View nestedReferenceSourceView, nestedReferenceTargetView; + public static View valueSourceView, valueTargetView; + public static View nestedValueSourceView, nestedValueTargetView; + + // Inherited nodes + public static View commentSourceView, commentTargetView, commentCNSourceView, commentCNTargetView; + public static View constraintSourceView, constraintTargetView, constraintCNSourceView, constraintCNTargetView; + + public static View partContainer1; // Its type block may be set encapsulated for testing purpose. + public static View partContainer2; // Its type block may be set encapsulated for testing purpose. + + public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>(); + + public static View subNestedActorPartContainer1_1_1SourceView; + + public static View subNestedActorPartContainer1_1_1TargetView; + + public static View portOnSubNestedPartSourceView; + + public static View portOnSubNestedPartTargetView; + + public static View flowportOnSubNestedPartSourceView; + + public static View flowportOnSubNestedPartTargetView; + + public static View portOnSubNestedPartContainer1_1_1SourceView; + + public static View portOnSubNestedPartContainer2_1_1TargetView; + + public static View portOnSubNestedPartContainer1_1_2TargetView; + + public static View flowportOnSubNestedPartContainer1_1_1SourceView; + + public static View flowportOnSubNestedPartContainer2_1_1TargetView; + + public static View portOnSubNestedPartContainer2SourceView; + + public static View portOnSubNestedPartContainer1_2_1TargetView; + + public static View flowportOnSubNestedPartContainer1_2_1TargetView; + + public static View flowportOnSubNestedPartContainer1_1_2TargetView; + + public static View subNestedPartContainer1_1_1SourceView; + + public static View subNestedPartContainer1_2_1TargetView; + + public static View subNestedPartContainer1_1_1TargetView; + + public static View subNestedPartContainer1_1_2TargetView; + + public static View subNestedPropertyContainer1_1_1SourceView; + + public static View subNestedPropertyContainer1_1_1TargetView; + + public static View subNestedPropertyContainer1_2_1TargetView; + + public static View subNestedPropertyContainer1_1_2TargetView; + + public static View subNestedReferenceContainer1_1_1SourceView; + + public static View subNestedReferenceContainer1_1_1TargetView; + + public static View subNestedReferenceContainer1_2_1TargetView; + + public static View subNestedReferenceContainer1_1_2TargetView; + + public static View subNestedValueContainer1_1_1SourceView; + + public static View subNestedValueContainer1_1_1TargetView, subNestedValueContainer1_2_1TargetView, subNestedValueContainer1_1_2TargetView; + + public static View subNestedActorPartContainer1_2_1TargetView; + + public static View subNestedActorPartContainer1_1_2TargetView; + + public static View nestedPartContainer1_1; + + public static View nestedPartContainer2_1; + + public static View nestedPartContainer1_2; + + @BeforeClass + public static void prepareInheritedNodes() throws Exception { + View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View containerCpt = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + + // Prepare elements for link creation tests + commentSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView()); + commentTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView()); + commentCNSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt); + commentCNTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt); + + constraintSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView()); + constraintTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView()); + constraintCNSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt); + constraintCNTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt); + } + + @BeforeClass + public static void prepareCustomNodes() throws Exception { + View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View blockStructureView = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + // part in block (level = 1) + partContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View partContainer1StructureView = ViewUtil.getChildBySemanticHint(partContainer1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + partContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View partContainer2StructureView = ViewUtil.getChildBySemanticHint(partContainer2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + + nestedPartContainer1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + View nestedPartContainer1_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + nestedPartContainer2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + View nestedPartContainer2_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer2_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + nestedPartContainer1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer2StructureView); + View nestedPartContainer1_2StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // nested container in nested part (level = 3) + View subNestedPartContainer1_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView); + View subNestedPartContainer2_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView); + + // nested container in nestedPartContainer2_1 (level = 3) + View subNestedPartContainer1_2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1StructureView); + + // nested container in nestedPartContainer1_2StructureView (level = 3) + View subNestedPartContainer1_1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2StructureView); + + + // Prepare elements for link creation tests + + blockSourceView = container; + blockTargetView = container; + + // Prepare child nodes + + partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPartSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedPartTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + // Port & FlowPorts no distinction made on FlowPorts kind... + portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container); + portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container); + portOnPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer1); + portOnPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer2); + portOnNestedPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer1_1); + portOnNestedPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer2_1); + portOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView); + portOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1); + portOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1); + portOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2); + + flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container); + flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container); + flowportOnPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer1); + flowportOnPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer2); + flowportOnNestedPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer1_1); + flowportOnNestedPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer2_1); + flowportOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView); + flowportOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1); + flowportOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1); + flowportOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2); + + propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedPropertyContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPropertyContainer1_1_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPropertyContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedPropertyContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedReferenceContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedReferenceContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedReferenceContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedReferenceContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + + valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedValueContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedValueContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedValueContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedValueContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + actorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedActorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedActorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedActorPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedActorPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedActorPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedActorPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + } +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java index fa782347d36..c2a10146539 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java @@ -1,184 +1,184 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorFromPalette;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkPrepareTest;
-import org.eclipse.uml2.uml.Property;
-import org.junit.Test;
-
-/**
- * JUnit abstract tests for Link creation test (via palette tools).
- */
-public class AbstractLinkCreationFromElementTest extends AbstractLinkPrepareTest {
-
- public static String toolID;
-
- public static View sourceView;
-
- public static Map<View, List<Property>> expectedSourceNestedPath;
-
- public static Map<View, List<Property>> expectedTargetNestedPath;
-
- @Test
- public void createLinkWithTargetBlock() throws Exception {
- View targetView = blockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetActorPart() throws Exception {
- View targetView = actorPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedActorPart() throws Exception {
- View targetView = nestedActorPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnBlock() throws Exception {
- View targetView = portOnBlockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnPart() throws Exception {
- View targetView = portOnPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnNestedPart() throws Exception {
- View targetView = portOnNestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnBlock() throws Exception {
- View targetView = flowportOnBlockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnPart() throws Exception {
- View targetView = flowportOnPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnNestedPart() throws Exception {
- View targetView = flowportOnNestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPart() throws Exception {
- View targetView = partTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedPart() throws Exception {
- View targetView = nestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetProperty() throws Exception {
- View targetView = propertyTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedProperty() throws Exception {
- View targetView = nestedPropertyTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetReference() throws Exception {
- View targetView = referenceTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedReference() throws Exception {
- View targetView = nestedReferenceTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetValue() throws Exception {
- View targetView = valueTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedValue() throws Exception {
- View targetView = nestedValueTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetComment() throws Exception {
- View targetView = commentTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetCommentCN() throws Exception {
- View targetView = commentCNTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetConstraint() throws Exception {
- View targetView = constraintTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetConstraintCN() throws Exception {
- View targetView = constraintCNTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- // deep nested tests
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_1_1() throws Exception {
- View targetView = subNestedPartContainer1_1_1TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_2_1() throws Exception {
- View targetView = subNestedPartContainer1_2_1TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_1_2() throws Exception {
- View targetView = subNestedPartContainer1_1_2TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorFromPalette; + +import java.util.List; +import java.util.Map; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkPrepareTest; +import org.eclipse.uml2.uml.Property; +import org.junit.Test; + +/** + * JUnit abstract tests for Link creation test (via palette tools). + */ +public abstract class AbstractLinkCreationFromElementTest extends AbstractLinkPrepareTest { + + public static String toolID; + + public static View sourceView; + + public static Map<View, List<Property>> expectedSourceNestedPath; + + public static Map<View, List<Property>> expectedTargetNestedPath; + + @Test + public void createLinkWithTargetBlock() throws Exception { + View targetView = blockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetActorPart() throws Exception { + View targetView = actorPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedActorPart() throws Exception { + View targetView = nestedActorPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnBlock() throws Exception { + View targetView = portOnBlockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnPart() throws Exception { + View targetView = portOnPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnNestedPart() throws Exception { + View targetView = portOnNestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnBlock() throws Exception { + View targetView = flowportOnBlockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnPart() throws Exception { + View targetView = flowportOnPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnNestedPart() throws Exception { + View targetView = flowportOnNestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPart() throws Exception { + View targetView = partTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedPart() throws Exception { + View targetView = nestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetProperty() throws Exception { + View targetView = propertyTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedProperty() throws Exception { + View targetView = nestedPropertyTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetReference() throws Exception { + View targetView = referenceTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedReference() throws Exception { + View targetView = nestedReferenceTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetValue() throws Exception { + View targetView = valueTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedValue() throws Exception { + View targetView = nestedValueTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetComment() throws Exception { + View targetView = commentTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetCommentCN() throws Exception { + View targetView = commentCNTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetConstraint() throws Exception { + View targetView = constraintTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetConstraintCN() throws Exception { + View targetView = constraintCNTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + // deep nested tests + @Test + public void createLinkWithTargetSubNestedPartContainer_1_1_1() throws Exception { + View targetView = subNestedPartContainer1_1_1TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetSubNestedPartContainer_1_2_1() throws Exception { + View targetView = subNestedPartContainer1_2_1TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetSubNestedPartContainer_1_1_2() throws Exception { + View targetView = subNestedPartContainer1_1_2TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java index 31580e444d0..121035955ad 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java @@ -1,108 +1,108 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- Property part1 = (Property)partContainer1.getElement();
- Property part2 = (Property)partContainer2.getElement();
- Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement();
- Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement();
- Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement();
- List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property });
- List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property });
- List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property });
- List<Property> nestedPath = Arrays.asList(new Property[]{ part1 });
- List<Property> emptyPath = Collections.emptyList();
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath);
- expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2);
- expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedValueTargetView, nestedPath);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + Property part1 = (Property)partContainer1.getElement(); + Property part2 = (Property)partContainer2.getElement(); + Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement(); + Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement(); + Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement(); + List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property }); + List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property }); + List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property }); + List<Property> nestedPath = Arrays.asList(new Property[]{ part1 }); + List<Property> emptyPath = Collections.emptyList(); + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath); + expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(nestedPartTargetView, nestedPath); + expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1); + expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1); + expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2); + expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath); + expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath); + expectedTargetNestedPath.put(nestedValueTargetView, nestedPath); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java index c69fa68fa83..8fd7b272028 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java @@ -1,111 +1,111 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- Property part1 = (Property)partContainer1.getElement();
- Property part2 = (Property)partContainer2.getElement();
- Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement();
- Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement();
- Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement();
- List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property });
- List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property });
- List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property });
- List<Property> nestedPath = Arrays.asList(new Property[]{ part1 });
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
-
- expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath);
- expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2);
- expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedValueTargetView, nestedPath);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + Property part1 = (Property)partContainer1.getElement(); + Property part2 = (Property)partContainer2.getElement(); + Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement(); + Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement(); + Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement(); + List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property }); + List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property }); + List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property }); + List<Property> nestedPath = Arrays.asList(new Property[]{ part1 }); + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + + expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath); + expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(nestedPartTargetView, nestedPath); + expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1); + expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1); + expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2); + expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath); + expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath); + expectedTargetNestedPath.put(nestedValueTargetView, nestedPath); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java index 581d4b8a395..bc3df808ce7 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java @@ -1,139 +1,155 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorAndTestDelegateFromPalette;
-
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.junit.Test;
-
-/**
- * JUnit abstract tests for Link creation test (via palette tools).
- */
-public class AbstractConnectorCreationAndTestDelegateFromElementTest extends AbstractConnectorCreationAndTestDelegatePrepareTest {
-
- public static String toolID;
-
- public static View sourceView;
-
- public static Map<View, ConnectableElement> expectedSourcePartWithPort;
-
- public static Map<View, ConnectableElement> expectedTargetPartWithPort;
-
- @Test
- public void createLinkWithSourceBlock() throws Exception {
- View targetView = blockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceActorPart() throws Exception {
- View targetView = actorPart2_BlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedActorPart() throws Exception {
- View targetView = actorPart2_p1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnBlock() throws Exception {
- View targetView = portOnBlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnPart() throws Exception {
- View targetView = port1_Part2TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnNestedPart() throws Exception {
- View targetView = port2OnNestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnBlock() throws Exception {
- View targetView = flowportOnBlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnPart() throws Exception {
- View targetView = flowport1_Part2TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnNestedPart() throws Exception {
- View targetView = flowport1_NestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePart() throws Exception {
- View targetView = partTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedPart() throws Exception {
- View targetView = nestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceProperty() throws Exception {
- View targetView = propertyTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedProperty() throws Exception {
- View targetView = nestedPropertyTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceReference() throws Exception {
- View targetView = referenceTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedReference() throws Exception {
- View targetView = nestedReferenceTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceValue() throws Exception {
- View targetView = valueTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedValue() throws Exception {
- View targetView = nestedValueTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorAndTestDelegateFromPalette; + +import java.util.Map; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.junit.Test; + +/** + * JUnit abstract tests for Link creation test (via palette tools). + */ +public abstract class AbstractConnectorCreationAndTestDelegateFromElementTest extends AbstractConnectorCreationAndTestDelegatePrepareTest { + + public static String toolID; + + public static View sourceView; + + public static Map<View, ConnectableElement> expectedSourcePartWithPort; + + public static Map<View, ConnectableElement> expectedTargetPartWithPort; + + // FIXME : wrong name in all methods => replace Source by Target + // BMA : ne passe pas là + @Test + public void createLinkWithSourceBlock() throws Exception { + View targetView = blockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceActorPart() throws Exception { + View targetView = actorPart2_BlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedActorPart() throws Exception { + View targetView = actorPart2_p1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnBlock() throws Exception { + View targetView = portOnBlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + // BMA : ne passe pas là + @Test + public void createLinkWithTargetPort2OnPart1() throws Exception { + View targetView = port2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + // BMA : ne passe pas là + @Test + public void createLinkWithTargetPort1OnPart1() throws Exception { + View targetView = port1_Part1SourceView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnPart() throws Exception { + View targetView = port1_Part2TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnNestedPart() throws Exception { + View targetView = port2OnNestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnBlock() throws Exception { + View targetView = flowportOnBlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnPart() throws Exception { + View targetView = flowport1_Part2TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnNestedPart() throws Exception { + View targetView = flowport1_NestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePart() throws Exception { + View targetView = partTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedPart() throws Exception { + View targetView = nestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceProperty() throws Exception { + View targetView = propertyTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedProperty() throws Exception { + View targetView = nestedPropertyTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceReference() throws Exception { + View targetView = referenceTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedReference() throws Exception { + View targetView = nestedReferenceTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceValue() throws Exception { + View targetView = valueTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedValue() throws Exception { + View targetView = nestedValueTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java index 1d6474568f0..bb7a2a132bd 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java @@ -1,143 +1,150 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView;
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for link creation test (via palette tools).
- */
-public class AbstractConnectorCreationAndTestDelegatePrepareTest extends AbstractTest {
-
- public static String toolID;
-
- // Custom nodes
- public static View blockSourceView, blockTargetView;
-
- // Custom child label nodes
- public static View actorPart1_BlockSourceView, actorPart2_BlockTargetView;
- public static View actorPart1_p1_SourceView, actorPart2_p1TargetView, actorPart1_p2TargetView, actorPart1_p1_p1SourceView, actorPart2_p1_p1TargetView, actorPart1_p2_p1TargetView, actorPart1_p1_p2TargetView;
- public static View portOnBlockSourceView, portOnBlockTargetView;
- public static View port1_Part1SourceView, port1_Part2TargetView;
- public static View port1OnNestedPart1_Part1SourceView, port2OnNestedPart2_Part1TargetView, port1OnNestedPart1_Part2TargetView;
- public static View flowportOnBlockSourceView, flowportOnBlockTargetView;
- public static View flowport1_Part1SourceView, flowport1_Part2TargetView;
- public static View flowport1_NestedPart1_Part1SourceView, flowport1_NestedPart2_Part1TargetView, flowport1_NestedPart1_Part2TargetView;
- public static View partSourceView, partTargetView;
- public static View nestedPart1_Part1SourceView, nestedPart2_Part1TargetView, nestedPart1_Part2TargetView;
- public static View propertySourceView, propertyTargetView;
- public static View nestedPropertySourceView, nestedPropertyTargetView;
- public static View referenceSourceView, referenceTargetView;
- public static View nestedReferenceSourceView, nestedReferenceTargetView;
- public static View valueSourceView, valueTargetView;
- public static View nestedValueSourceView, nestedValueTargetView;
-
- public static View p1View; // Its type block may be set encapsulated for testing purpose.
- public static View p2View; // Its type block may be set encapsulated for testing purpose.
- public static View p1_p1View, p2_p1View;
- public static View p1_p1StructureView, p2_p1StructureView;
- public static View p1_p2View;
- public static View p1_p2StructureView;
-
-
- public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
-
- @BeforeClass
- public static void prepareCustomNodes() throws Exception {
- View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View blockStructureView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
- p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // nested part to contain elements to be tested on level 2
- p1_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- p1_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p2_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- p2_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p1_p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
- p1_p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // Prepare elements for link creation tests
-
- blockSourceView = blockView;
- blockTargetView = blockView;
-
- // Prepare child nodes
- actorPart1_BlockSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPart2_BlockTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPart1_p1_SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- actorPart2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- actorPart1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
- actorPart1_p1_p1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView);
- actorPart2_p1_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView);
- actorPart1_p2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2_p1StructureView);
- actorPart1_p1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p2StructureView);
-
-
- // Port & FlowPorts no distinction made on FlowPorts kind...
- portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView);
- portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView);
- port1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View);
- port1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View);
- port1OnNestedPart1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p1View);
- port2OnNestedPart2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2_p1View);
- port1OnNestedPart1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p2View);
-
- flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView);
- flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView);
- flowport1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1View);
- flowport1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2View);
- flowport1_NestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p1View);
- flowport1_NestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2_p1View);
- flowport1_NestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p2View);
-
- partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
-
- propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
-
- referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
-
- valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- }
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView; +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; +import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.BeforeClass; + +/** + * JUnit tests for link creation test (via palette tools). + */ +public abstract class AbstractConnectorCreationAndTestDelegatePrepareTest extends AbstractTest { + + public static String toolID; + + // Custom nodes + public static View blockSourceView, blockTargetView; + + // Custom child label nodes + public static View actorPart1_BlockSourceView, actorPart2_BlockTargetView; + public static View actorPart1_p1_SourceView, actorPart2_p1TargetView, actorPart1_p2TargetView, actorPart1_p1_p1SourceView, actorPart2_p1_p1TargetView, actorPart1_p2_p1TargetView, actorPart1_p1_p2TargetView; + public static View portOnBlockSourceView, portOnBlockTargetView; + public static View port1_Part1SourceView, port2_Part1TargetView, port1_Part2TargetView, port2_Part2TargetView; + public static View port1OnNestedPart1_Part1SourceView, port2OnNestedPart2_Part1TargetView, port1OnNestedPart1_Part2TargetView; + public static View flowportOnBlockSourceView, flowportOnBlockTargetView; + public static View flowport1_Part1SourceView, flowport1_Part2TargetView; + public static View flowport1_NestedPart1_Part1SourceView, flowport1_NestedPart2_Part1TargetView, flowport1_NestedPart1_Part2TargetView; + public static View partSourceView, partTargetView; + public static View nestedPart1_Part1SourceView, nestedPart2_Part1TargetView, nestedPart1_Part2TargetView; + public static View propertySourceView, propertyTargetView; + public static View nestedPropertySourceView, nestedPropertyTargetView; + public static View referenceSourceView, referenceTargetView; + public static View nestedReferenceSourceView, nestedReferenceTargetView; + public static View valueSourceView, valueTargetView; + public static View nestedValueSourceView, nestedValueTargetView; + + public static View p1View; // Its type block may be set encapsulated for testing purpose. + public static View p2View; // Its type block may be set encapsulated for testing purpose. + public static View p1_p1View, p2_p1View; + public static View p1_p1StructureView, p2_p1StructureView; + public static View p1_p2View; + public static View p1_p2StructureView; + + + public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>(); + + @BeforeClass + public static void prepareCustomNodes() throws Exception { + View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View blockStructureView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // nested part to contain elements to be tested on level 2 + p1_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + p1_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p2_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + p2_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p1_p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + p1_p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // Prepare elements for link creation tests + + blockSourceView = blockView; + blockTargetView = blockView; + + // Prepare child nodes + actorPart1_BlockSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPart2_BlockTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPart1_p1_SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + actorPart2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + actorPart1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + actorPart1_p1_p1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView); + actorPart2_p1_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView); + actorPart1_p2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2_p1StructureView); + actorPart1_p1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p2StructureView); + + + // Port & FlowPorts no distinction made on FlowPorts kind... + portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView); + portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView); + port1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View); + port2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View); + port1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View); + + // BMA temp + port2_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View); + + // ?? kesako ? + port1OnNestedPart1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p1View); + port2OnNestedPart2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2_p1View); + port1OnNestedPart1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p2View); + + flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView); + flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView); + flowport1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1View); + flowport1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2View); + flowport1_NestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p1View); + flowport1_NestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2_p1View); + flowport1_NestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p2View); + + partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + + propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + } +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java index ee28e38faf8..68d13cdfb21 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = actorPart1_BlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = actorPart1_BlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java index 522436ddf34..1e25e37a136 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java index b476916d57a..6c0443359d7 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java @@ -1,89 +1,91 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowport1_NestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property sourceNestedpart = (Property)p1_p1View.getElement();
-
- Property targetpart = (Property)p2View.getElement();
- Property targetNestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, sourceNestedpart);
- }
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowport1_NestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property sourceNestedpart = (Property)p1_p1View.getElement(); + + Property targetpart = (Property)p2View.getElement(); + Property targetNestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, sourceNestedpart); + } + + expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java index fb793d13f81..f2a0e00fb8c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java @@ -1,96 +1,99 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowport1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part1 = (Property)p1View.getElement();
- Property part2 = (Property)p2View.getElement();
- Property nestedPart2 = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, part1);
- }
-
- expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(actorPart2_p1TargetView);
- expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(nestedPropertyTargetView);
- expectedSourcePartWithPort.remove(nestedReferenceTargetView);
- expectedSourcePartWithPort.remove(nestedValueTargetView);
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part2);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowport1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedPart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, part1); + } + expectedSourcePartWithPort.remove(port1_Part1SourceView); + expectedSourcePartWithPort.remove(port2_Part1TargetView); + expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(actorPart2_p1TargetView); + expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(nestedPropertyTargetView); + expectedSourcePartWithPort.remove(nestedReferenceTargetView); + expectedSourcePartWithPort.remove(nestedValueTargetView); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java index b554f662190..0cb2a661f37 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = actorPart1_p1_SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = actorPart1_p1_SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java index c59c5294130..9d65104a659 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java index 65d36961241..96792ca698b 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedPropertySourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedPropertySourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java index 208eb5be469..12f49ae4035 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedReference extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedReferenceSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedReference extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedReferenceSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java index 6277e861e1c..464b3d13ca1 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedValue extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedValueSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedValue extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedValueSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java index 6030bcc815e..aedf2fe7273 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = partSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = partSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java index 86ebc85e890..1a4fc9bb12c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java index d4fe4835eb5..119aee81813 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java @@ -1,89 +1,91 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = port1OnNestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property sourceNestedpart = (Property)p1_p1View.getElement();
-
- Property targetpart = (Property)p2View.getElement();
- Property targetNestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, sourceNestedpart);
- }
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = port1OnNestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property sourceNestedpart = (Property)p1_p1View.getElement(); + + Property targetpart = (Property)p2View.getElement(); + Property targetNestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, sourceNestedpart); + } + + expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java index 9f12d238a42..c08a697c828 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java @@ -1,96 +1,100 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = port1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part1 = (Property)p1View.getElement();
- Property part2 = (Property)p2View.getElement();
- Property nestedPart2 = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, part1);
- }
-
- expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(actorPart2_p1TargetView);
- expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(nestedPropertyTargetView);
- expectedSourcePartWithPort.remove(nestedReferenceTargetView);
- expectedSourcePartWithPort.remove(nestedValueTargetView);
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part2);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = port1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedPart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, part1); + } + + expectedSourcePartWithPort.remove(port1_Part1SourceView); + expectedSourcePartWithPort.remove(port2_Part1TargetView); + expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(actorPart2_p1TargetView); + expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(nestedPropertyTargetView); + expectedSourcePartWithPort.remove(nestedReferenceTargetView); + expectedSourcePartWithPort.remove(nestedValueTargetView); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java index e0a2db10113..5bea2abc30a 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = propertySourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = propertySourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java index 2440b9dbd22..57d4f1b65ed 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromReference extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = referenceSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromReference extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = referenceSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java index 6c8834811e4..a9fd1985284 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromValue extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = valueSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromValue extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = valueSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java index 5d2d4d0c2f7..44f7350e9e1 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java @@ -1,90 +1,90 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, false);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, false);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, false);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, false);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, false);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, false);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, false); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, false); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, false); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, false); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, false); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, false); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java index db6c6dc4b1f..1dc9c1b031f 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java @@ -1,90 +1,90 @@ -/*****************************************************************************
- * 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
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, false);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, false);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, false);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, false);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, false);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, false);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- }
-
-}
+/***************************************************************************** + * 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 + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, false); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, false); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, false); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, false); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, false); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, false); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.classpath b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.classpath new file mode 100644 index 00000000000..969b4034060 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.classpath @@ -0,0 +1,7 @@ +<?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="test"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project new file mode 100644 index 00000000000..d14346dbd0a --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.uml.diagram.composite.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/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..af0f20f97a5 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..adba4d1e6bd --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,26 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.composite.tests +Bundle-Activator: org.eclipse.papyrus.uml.diagram.composite.test.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.core;bundle-version="0.10.1", + org.eclipse.papyrus.editor;bundle-version="0.10.1", + org.eclipse.papyrus.uml.diagram.clazz;bundle-version="0.10.1", + org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1", + org.eclipse.papyrus.uml.diagram.composite, + org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1", + org.eclipse.papyrus.diagram.tests;bundle-version="0.10.1", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1", + org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.1", + org.junit;bundle-version="4.10.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy +Bundle-Vendor: %providerName +Bundle-Version: 0.10.1.qualifier +Export-Package: org.eclipse.papyrus.uml.diagram.composite.test, + org.eclipse.papyrus.uml.diagram.composite.test.canonical diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/about.html b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/build.properties b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/build.properties new file mode 100644 index 00000000000..3c5666a8ae0 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + org.eclipse.papyrus.uml.diagram.composite.test.launch,\ + plugin.properties diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/org.eclipse.papyrus.uml.diagram.composite.test.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/org.eclipse.papyrus.uml.diagram.composite.test.launch new file mode 100644 index 00000000000..b35686d445d --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/org.eclipse.papyrus.uml.diagram.composite.test.launch @@ -0,0 +1,43 @@ +<?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"/> +<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.composite.tests"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.papyrus.uml.diagram.composite.tests"/> +<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=""/> +<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.composite.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="-Dosgi.requiredJavaVersion=1.5 -Xms256m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.platform.ide"/> +<booleanAttribute key="run_in_ui_thread" value="true"/> +<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,javaewah@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@default:default,lpg.runtime.java@default:default,net.sf.eclipsecs.branding@default:default,net.sf.eclipsecs.checkstyle@default:default,net.sf.eclipsecs.core@default:default,net.sf.eclipsecs.doc@default:default,net.sf.eclipsecs.ui@default:default,net.sf.jautodoc.velocity@default:default,net.sf.jautodoc@default:default,net.sourceforge.nattable.core@default:default,org.antlr.runtime@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.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@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.parser@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.cdt.codan.core.cxx@default:default,org.eclipse.cdt.codan.core@default:default,org.eclipse.cdt.codan.ui.cxx@default:default,org.eclipse.cdt.codan.ui@default:default,org.eclipse.cdt.core@default:default,org.eclipse.cdt.make.core@default:default,org.eclipse.cdt.managedbuilder.core@default:default,org.eclipse.cdt.ui@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.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@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.cdo.common@default:default,org.eclipse.emf.cdo.dawn.gmf@default:default,org.eclipse.emf.cdo.dawn.ui@default:default,org.eclipse.emf.cdo.dawn.util@default:default,org.eclipse.emf.cdo.dawn@default:default,org.eclipse.emf.cdo.edit@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.transfer.repository@default:default,org.eclipse.emf.cdo.transfer.ui@default:default,org.eclipse.emf.cdo.transfer@default:default,org.eclipse.emf.cdo.ui.shared@default:default,org.eclipse.emf.cdo.ui@default:default,org.eclipse.emf.cdo@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.diagram@default:default,org.eclipse.emf.compare.edit@default:default,org.eclipse.emf.compare.ide@default:default,org.eclipse.emf.compare.rcp@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.metamodel@default:default,org.eclipse.emf.facet.common.core@default:default,org.eclipse.emf.facet.common.ui@default:default,org.eclipse.emf.facet.custom.core@default:default,org.eclipse.emf.facet.custom.metamodel@default:default,org.eclipse.emf.facet.custom.ui@default:default,org.eclipse.emf.facet.efacet.catalog@default:default,org.eclipse.emf.facet.efacet.core@default:default,org.eclipse.emf.facet.efacet.metamodel@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.ui@default:default,org.eclipse.emf.facet.infra.browser.custom@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@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.ui@default:default,org.eclipse.emf.facet.util.ui@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@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@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.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.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.utils@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.query.doc@default:default,org.eclipse.emf.query.examples@default:default,org.eclipse.emf.query.ocl@default:default,org.eclipse.emf.query@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.epp.mpc.core@default:default,org.eclipse.epp.mpc.help.ui@default:default,org.eclipse.epp.mpc.ui@default:default,org.eclipse.epp.package.standard@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.discovery.compatibility@default:default,org.eclipse.equinox.p2.discovery@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.discovery@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.lite.svg@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.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@default:default,org.eclipse.m2m.qvt.oml.cst.parser@default:default,org.eclipse.m2m.qvt.oml.ecore.imperativeocl@default:default,org.eclipse.m2m.qvt.oml.emf.util@default:default,org.eclipse.m2m.qvt.oml.project@default:default,org.eclipse.m2m.qvt.oml.runtime@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.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.repositories.core@default:default,org.eclipse.mylyn.commons.repositories.ui@default:default,org.eclipse.mylyn.commons.screenshots@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.discovery.core@default:default,org.eclipse.mylyn.discovery.ui@default:default,org.eclipse.mylyn.git.core@default:default,org.eclipse.mylyn.git.ui@default:default,org.eclipse.mylyn.monitor.core@default:default,org.eclipse.mylyn.monitor.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.versions.core@default:default,org.eclipse.mylyn.versions.ui@default:default,org.eclipse.nebula.widgets.nattable.core@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.ui.shared@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default,org.eclipse.ocl.common.ui@default:default,org.eclipse.ocl.common@default:default,org.eclipse.ocl.ecore@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.examples.xtext.markup.ui@default:default,org.eclipse.ocl.examples.xtext.markup@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.papyrus.acceleo@default:default,org.eclipse.papyrus.cdo.core@default:default,org.eclipse.papyrus.cdo.ui.customization.properties@default:default,org.eclipse.papyrus.cdo.ui.doc@default:default,org.eclipse.papyrus.cdo.ui@default:default,org.eclipse.papyrus.cdo.uml.diagram.ui@default:default,org.eclipse.papyrus.cdo.uml.ui@default:default,org.eclipse.papyrus.cdo.validation.problems.edit@default:default,org.eclipse.papyrus.cdo.validation.problems@default:default,org.eclipse.papyrus.cpp.codegen.ui@default:default,org.eclipse.papyrus.cpp.codegen@default:default,org.eclipse.papyrus.cpp.profile@default:default,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@default:default,org.eclipse.papyrus.customization@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.dsml.validation.doc@default:default,org.eclipse.papyrus.dsml.validation.generator@default:default,org.eclipse.papyrus.dsml.validation.model.ui@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.eastadl@default:default,org.eclipse.papyrus.eclipse.project.editors@default:default,org.eclipse.papyrus.editor@default:default,org.eclipse.papyrus.fcm.profile@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@default:default,org.eclipse.papyrus.infra.core.sasheditor@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.doc@default:default,org.eclipse.papyrus.infra.emf.appearance@default:default,org.eclipse.papyrus.infra.emf.diagram.common@default:default,org.eclipse.papyrus.infra.emf.facet.queries@default:default,org.eclipse.papyrus.infra.emf.nattable.converter@default:default,org.eclipse.papyrus.infra.emf.nattable@default:default,org.eclipse.papyrus.infra.emf.readonly@default:default,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.css.doc@default:default,org.eclipse.papyrus.infra.gmfdiag.modelexplorer@default:default,org.eclipse.papyrus.infra.hyperlink@default:default,org.eclipse.papyrus.infra.nattable.common@default:default,org.eclipse.papyrus.infra.nattable.controlmode@default:default,org.eclipse.papyrus.infra.nattable.model.edit@default:default,org.eclipse.papyrus.infra.nattable.model.editor@default:default,org.eclipse.papyrus.infra.nattable.model@default:default,org.eclipse.papyrus.infra.nattable.modelexplorer@default:default,org.eclipse.papyrus.infra.nattable.properties@default:default,org.eclipse.papyrus.infra.nattable.views.config@default:default,org.eclipse.papyrus.infra.nattable.views.editor@default:default,org.eclipse.papyrus.infra.nattable@default:default,org.eclipse.papyrus.infra.onefile@default:default,org.eclipse.papyrus.infra.psf@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@default:default,org.eclipse.papyrus.infra.services.labelprovider@default:default,org.eclipse.papyrus.infra.services.markerlistener@default:default,org.eclipse.papyrus.infra.services.navigation@default:default,org.eclipse.papyrus.infra.services.openelement@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.tracepoints@default:default,org.eclipse.papyrus.infra.services.validation@default:default,org.eclipse.papyrus.infra.services.viewersearch@default:default,org.eclipse.papyrus.infra.services.viewlabelprovider@default:default,org.eclipse.papyrus.infra.table.common@default:default,org.eclipse.papyrus.infra.table.controlmode@default:default,org.eclipse.papyrus.infra.table.instance@default:default,org.eclipse.papyrus.infra.table.menu@default:default,org.eclipse.papyrus.infra.table.modelexplorer@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel.edit@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel.editor@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel@default:default,org.eclipse.papyrus.infra.table.properties@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.java.generator.jdtsynchronizer@default:default,org.eclipse.papyrus.java.generator.metamodel.jdt.edit@default:default,org.eclipse.papyrus.java.generator.metamodel.jdt.editor@default:default,org.eclipse.papyrus.java.generator.metamodel.jdt@default:default,org.eclipse.papyrus.java.generator.transfo.umltojdt@default:default,org.eclipse.papyrus.java.generator.ui@default:default,org.eclipse.papyrus.java.profile.edit@default:default,org.eclipse.papyrus.java.profile.editor@default:default,org.eclipse.papyrus.java.profile@default:default,org.eclipse.papyrus.java.reverse.ui@default:default,org.eclipse.papyrus.java.reverse@default:default,org.eclipse.papyrus.marte.properties@default:default,org.eclipse.papyrus.marte.static.profile@default:default,org.eclipse.papyrus.marte.textedit.constraintwithvsl.xtext.ui@default:default,org.eclipse.papyrus.marte.textedit.constraintwithvsl.xtext@default:default,org.eclipse.papyrus.marte.textedit.stereotypeapplicationwithvsl.xtext.ui@default:default,org.eclipse.papyrus.marte.textedit.stereotypeapplicationwithvsl.xtext@default:default,org.eclipse.papyrus.marte.vsl.ui@default:default,org.eclipse.papyrus.marte.vsl@default:default,org.eclipse.papyrus.migration.properties.model@default:default,org.eclipse.papyrus.robotml.diagram.architecture@default:default,org.eclipse.papyrus.robotml.diagram.common@default:default,org.eclipse.papyrus.robotml.diagram.componentdef@default:default,org.eclipse.papyrus.robotml.diagram.datatypedef@default:default,org.eclipse.papyrus.robotml.diagram.interfacedef@default:default,org.eclipse.papyrus.robotml.diagram.ui@default:default,org.eclipse.papyrus.robotml.doc@default:default,org.eclipse.papyrus.robotml.generators.common@default:default,org.eclipse.papyrus.robotml.generators.intempora.rtmaps.ui@default:default,org.eclipse.papyrus.robotml.generators.intempora.rtmaps@default:default,org.eclipse.papyrus.robotml.modelexplorer@default:default,org.eclipse.papyrus.robotml.perspective@default:default,org.eclipse.papyrus.robotml.templaterepository@default:default,org.eclipse.papyrus.robotml.validation@default:default,org.eclipse.papyrus.robotml@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@default:default,org.eclipse.papyrus.sysml.nattable.allocation.config@default:default,org.eclipse.papyrus.sysml.nattable.allocation@default:default,org.eclipse.papyrus.sysml.nattable.menu@default:default,org.eclipse.papyrus.sysml.nattable.requirement.config@default:default,org.eclipse.papyrus.sysml.nattable.requirement@default:default,org.eclipse.papyrus.sysml.nattable@default:default,org.eclipse.papyrus.sysml.properties@default:default,org.eclipse.papyrus.sysml.table.allocation@default:default,org.eclipse.papyrus.sysml.table.requirement@default:default,org.eclipse.papyrus.texteditor.cdt@default:default,org.eclipse.papyrus.texteditor.model@default:default,org.eclipse.papyrus.texteditor.modelexplorer@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@default:default,org.eclipse.papyrus.uml.controlmode.profile@default:default,org.eclipse.papyrus.uml.diagram.activity@default:default,org.eclipse.papyrus.uml.diagram.clazz@default:default,org.eclipse.papyrus.uml.diagram.common.doc@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.communication@default:default,org.eclipse.papyrus.uml.diagram.css@default:default,org.eclipse.papyrus.uml.diagram.deployment@default:default,org.eclipse.papyrus.uml.diagram.dnd@default:default,org.eclipse.papyrus.uml.diagram.icons@default:default,org.eclipse.papyrus.uml.diagram.interactionoverview@default:default,org.eclipse.papyrus.uml.diagram.modelexplorer@default:default,org.eclipse.papyrus.uml.diagram.navigation@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration@default:default,org.eclipse.papyrus.uml.diagram.pkg@default:default,org.eclipse.papyrus.uml.diagram.profile.doc@default:default,org.eclipse.papyrus.uml.diagram.profile@default:default,org.eclipse.papyrus.uml.diagram.sequence@default:default,org.eclipse.papyrus.uml.diagram.statemachine@default:default,org.eclipse.papyrus.uml.diagram.stereotype.edition@default:default,org.eclipse.papyrus.uml.diagram.symbols@default:default,org.eclipse.papyrus.uml.diagram.timing@default:default,org.eclipse.papyrus.uml.diagram.usecase@default:default,org.eclipse.papyrus.uml.documentation.profile@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.widgets@default:default,org.eclipse.papyrus.uml.modelexplorer@default:default,org.eclipse.papyrus.uml.modelrepair@default:default,org.eclipse.papyrus.uml.nattable.generic.config@default:default,org.eclipse.papyrus.uml.nattable.generic@default:default,org.eclipse.papyrus.uml.nattable.menu@default:default,org.eclipse.papyrus.uml.nattable@default:default,org.eclipse.papyrus.uml.navigation@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.profilefacet.generation@default:default,org.eclipse.papyrus.uml.profilefacet.metamodel@default:default,org.eclipse.papyrus.uml.profilefacet@default:default,org.eclipse.papyrus.uml.properties@default:default,org.eclipse.papyrus.uml.resourceloading.profile@default:default,org.eclipse.papyrus.uml.search.ui.doc@default:default,org.eclipse.papyrus.uml.search.ui@default:default,org.eclipse.papyrus.uml.service.validation@default:default,org.eclipse.papyrus.uml.services.decoration@default:default,org.eclipse.papyrus.uml.table.common@default:default,org.eclipse.papyrus.uml.table.default@default:default,org.eclipse.papyrus.uml.table.widgets.celleditors@default:default,org.eclipse.papyrus.uml.templaterepository@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext@default:default,org.eclipse.papyrus.uml.textedit.common.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.common.xtext@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext@default:default,org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext@default:default,org.eclipse.papyrus.uml.textedit.javaconstraint@default:default,org.eclipse.papyrus.uml.textedit.message.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.message.xtext@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext@default:default,org.eclipse.papyrus.uml.textedit.port.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.port.xtext@default:default,org.eclipse.papyrus.uml.textedit.property.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.property.xtext@default:default,org.eclipse.papyrus.uml.textedit.state.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.state.xtext@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext@default:default,org.eclipse.papyrus.uml.tools.extendedtypes@default:default,org.eclipse.papyrus.uml.tools.utils@default:default,org.eclipse.papyrus.uml.tools@default:default,org.eclipse.papyrus.umlrt.properties@default:default,org.eclipse.papyrus.umlrt.validation@default:default,org.eclipse.papyrus.umlrt.wizard@default:default,org.eclipse.papyrus.umlrt@default:default,org.eclipse.papyrus.views.cpp@default:default,org.eclipse.papyrus.views.modelexplorer.resourceloading@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.views.search@default:default,org.eclipse.papyrus.views.tracepoints@default:default,org.eclipse.papyrus.views.validation@default:default,org.eclipse.papyrus.xwt@default:default,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.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.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@default:default,org.eclipse.uml2.common.edit@default:default,org.eclipse.uml2.common@default:default,org.eclipse.uml2.types@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.update.configurator@3:true,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.xpand@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtend.typesystem.emf@default:default,org.eclipse.xtend@default:default,org.eclipse.xtext.builder@default:default,org.eclipse.xtext.common.types.edit@default:default,org.eclipse.xtext.common.types.ui@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.ecore@default:default,org.eclipse.xtext.generator@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.shared@default:default,org.eclipse.xtext.ui@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.objectweb.asm@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.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.def@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.domaincontextcodegen@default:default,org.eclipse.papyrus.editor.integration.tests@default:default,org.eclipse.papyrus.extensionpoints.editors@default:default,org.eclipse.papyrus.gmfgenextension@default:default,org.eclipse.papyrus.infra.core.sasheditor.di.tests@default:false,org.eclipse.papyrus.infra.core.sasheditor.tests@default:false,org.eclipse.papyrus.infra.core@default:default,org.eclipse.papyrus.infra.emf.tests@default:false,org.eclipse.papyrus.infra.gmfdiag.commands@default:default,org.eclipse.papyrus.infra.gmfdiag.common@default:default,org.eclipse.papyrus.infra.gmfdiag.controlmode@default:default,org.eclipse.papyrus.infra.gmfdiag.css.configuration@default:default,org.eclipse.papyrus.infra.gmfdiag.css.debug@default:default,org.eclipse.papyrus.infra.gmfdiag.css.model@default:default,org.eclipse.papyrus.infra.gmfdiag.css.properties@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.gmfmenu.filter@default:default,org.eclipse.papyrus.infra.gmfdiag.hyperlink@default:default,org.eclipse.papyrus.infra.gmfdiag.menu@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.viewersearcher@default:default,org.eclipse.papyrus.infra.gmfdiag.widgets@default:default,org.eclipse.papyrus.infra.gmfdiag.xtext.glue@default:default,org.eclipse.papyrus.infra.services.edit.tests@default:false,org.eclipse.papyrus.infra.services.labelprovider.tests@default:default,org.eclipse.papyrus.infra.tools@default:default,org.eclipse.papyrus.junit.utils@default:default,org.eclipse.papyrus.paletteconfiguration.tests@default:false,org.eclipse.papyrus.search.tests@default:default,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.tests@default:default,org.eclipse.papyrus.sysml.modelexplorer.tests@default:false,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.uml.diagram.activity.tests@default:default,org.eclipse.papyrus.uml.diagram.common@default:default,org.eclipse.papyrus.uml.diagram.component.tests@default:default,org.eclipse.papyrus.uml.diagram.component@default:default,org.eclipse.papyrus.uml.diagram.composite.tests@default:default,org.eclipse.papyrus.uml.diagram.composite@default:default,org.eclipse.papyrus.uml.diagram.deployment.tests@default:default,org.eclipse.papyrus.uml.diagram.dnd.tests@default:default,org.eclipse.papyrus.uml.diagram.interactionoverview.tests@default:default,org.eclipse.papyrus.uml.diagram.menu@default:default,org.eclipse.papyrus.uml.diagram.pkg.tests@default:default,org.eclipse.papyrus.uml.diagram.sequence.tests@default:default,org.eclipse.papyrus.uml.diagram.timing.tests@default:default,org.eclipse.papyrus.uml.diagram.usecase.tests@default:default,org.eclipse.papyrus.uml.diagram.wizards.tests@default:default,org.eclipse.papyrus.uml.diagram.wizards@default:default,org.eclipse.papyrus.uml.modelexplorer.tests@default:default,org.eclipse.papyrus.uml.service.types.tests@default:false,org.eclipse.papyrus.uml.service.types@default:default,org.eclipse.papyrus.views.modelexplorer.tests@default:default,org.eclipse.uml2.uml@default:default"/> +<booleanAttribute key="show_selected_only" value="false"/> +<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/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/plugin.properties b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/plugin.properties new file mode 100644 index 00000000000..1e83bebbf82 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# Copyright (c) 2014 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: +# Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - initial API and implementation +################################################################################## +pluginName=Papyrus Composite Diagram Test (Incubation) +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/Activator.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/Activator.java new file mode 100644 index 00000000000..7d5a21cd95d --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/Activator.java @@ -0,0 +1,65 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * (CEA LIST) - Initial API and implementation + /*****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test; + +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.composite.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(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(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/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/AllTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/AllTests.java new file mode 100644 index 00000000000..33977b84f48 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/AllTests.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test; + +import org.eclipse.papyrus.uml.diagram.composite.test.canonical.AllCanonicalTests; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * All tests together. + */ +@RunWith(Suite.class) +@SuiteClasses({ +// canonical +AllCanonicalTests.class, +// load +}) +public class AllTests { +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/ICompositeDiagramTestsConstants.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/ICompositeDiagramTestsConstants.java new file mode 100644 index 00000000000..eac50cb454a --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/ICompositeDiagramTestsConstants.java @@ -0,0 +1,22 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) - Initial API and implementation + /*****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test; + +public interface ICompositeDiagramTestsConstants { + + /** name of the test project */ + public final String PROJECT_NAME = "CompositeDiagramTestProject"; + + /** name of the test model */ + public final String FILE_NAME = "CompositeDiagramTest.di"; +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/AllCanonicalTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/AllCanonicalTests.java new file mode 100644 index 00000000000..06ff89935e1 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/AllCanonicalTests.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test.canonical; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * All test in canonical package + */ +@RunWith(Suite.class) +@SuiteClasses({ +//test links +TestCompositeDiagramSimpleLink.class, TestCompositeDiagramLinkOwnedBySource.class, TestCompositeDiagramElementWithSameParentLink.class, TestCompositeDiagramElementWithDifferentParentLink.class }) +public class AllCanonicalTests { +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java new file mode 100644 index 00000000000..34841a567d7 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithDifferentParentLink.java @@ -0,0 +1,185 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test.canonical; + +import java.util.List; + +import org.eclipse.gef.commands.Command; +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.emf.type.core.IElementType; +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent; +import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand; +import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes; +import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants; +import org.junit.Test; + + +/** + * The Class TestCompositeDiagramElementWithDifferentParentLink. + */ +public class TestCompositeDiagramElementWithDifferentParentLink extends TestLinkWithParent { + + + /** The target parent. */ + private GraphicalEditPart targetParent; + + /** + * Gets the diagram command creation. + * + * @return the diagram command creation + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation() + */ + + @Override + protected ICreationCommand getDiagramCommandCreation() { + return new CreateCompositeDiagramCommand(); + } + + /** + * Gets the project name. + * + * @return the project name + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName() + */ + + @Override + protected String getProjectName() { + return ICompositeDiagramTestsConstants.PROJECT_NAME; + } + + /** + * Gets the file name. + * + * @return the file name + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName() + */ + + @Override + protected String getFileName() { + return ICompositeDiagramTestsConstants.FILE_NAME; + } + + + /** + * Sets the up. + * + * @throws Exception the exception + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#setUp() + */ + + @Override + protected void setUp() throws Exception { + super.setUp(); + parentType = UMLElementTypes.Class_2073; + } + + + /** + * Inits the configuration for a link owned by the parent. + */ + protected void initConfLinkOwnedByParent(){ + // expected values before link creation + beginRootSemanticOwnedElementSize = 2; + beginDiagramEditPartChildrenSize = 2; + beginRootEdgeSize = 0; + beginSourceConnectionsSize = 0; + beginRootViewChildrenSize = 2; + // expected values after link creation + endSourceConnectionsSize = beginSourceConnectionsSize + 1; + endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize + 1; + endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize; + endRootEdgeSize = beginRootEdgeSize + 1; + endRootViewChildrenSize = beginRootViewChildrenSize; + } + + + /** + * Install environment. + * + * @param sourceType the source type + * @param targetType the target type + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.gmf.runtime.emf.type.core.IElementType) + */ + + @Override + public void installEnvironment(IElementType sourceType, IElementType targetType) { + super.installEnvironment(sourceType, targetType); + + //create the parent source + CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(parentType, getDiagramEditPart().getDiagramPreferencesHint()); + requestcreation.setLocation(DEFAULT_PARENT_LOCATION); + Command command = getDiagramEditPart().getCommand(requestcreation); + assertTrue(command.canExecute()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + targetParent = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1); + + //create the target + requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint()); + requestcreation.setLocation(DEFAULT_SOURCE_LOCATION); + command = targetParent.getCommand(requestcreation); + assertTrue(command.canExecute()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + + // FIXME : get(0) : header; get(1) : container + List<GraphicalEditPart> children = targetParent.getChildren(); + target = (GraphicalEditPart)children.get(2); + } + + /** + * Test to manage port connector. + */ + @Test + public void testToManagePortConnector() { + testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Connector_4013); + } + + /** + * Test to manage port usage. + */ + @Test + public void testToManagePortUsage() { + initConfLinkOwnedByParent(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Usage_4008, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port abstraction. + */ + @Test + public void testToManagePortAbstraction() { + initConfLinkOwnedByParent(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Abstraction_4007, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port substitution. + */ + @Test + public void testToManagePortSubstitution() { + initConfLinkOwnedByParent(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Substitution_4011, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port generalization. + */ + @Test + public void testToManagePortGeneralization() { + testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Generalization_4015); + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java new file mode 100644 index 00000000000..3ba2b068662 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramElementWithSameParentLink.java @@ -0,0 +1,192 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test.canonical; + +import java.util.List; + +import org.eclipse.gef.commands.Command; +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.emf.type.core.IElementType; +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent; +import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand; +import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes; +import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants; +import org.junit.Test; + +/** + * The Class TestCompositeDiagramElementWithSameParentLink. + */ +public class TestCompositeDiagramElementWithSameParentLink extends TestLinkWithParent { + + + /** + * Gets the diagram command creation. + * + * @return the diagram command creation + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation() + */ + + @Override + protected ICreationCommand getDiagramCommandCreation() { + return new CreateCompositeDiagramCommand(); + } + + /** + * Gets the project name. + * + * @return the project name + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName() + */ + + @Override + protected String getProjectName() { + return ICompositeDiagramTestsConstants.PROJECT_NAME; + } + + /** + * Gets the file name. + * + * @return the file name + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName() + */ + + @Override + protected String getFileName() { + return ICompositeDiagramTestsConstants.FILE_NAME; + } + + + /** + * Sets the up. + * + * @throws Exception the exception + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#setUp() + */ + + @Override + protected void setUp() throws Exception { + super.setUp(); + parentType = UMLElementTypes.Class_2073; + } + + + /** + * Install environment. + * + * @param sourceType the source type + * @param targetType the target type + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLinkWithParent#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.gmf.runtime.emf.type.core.IElementType) + */ + + @Override + public void installEnvironment(IElementType sourceType, IElementType targetType) { + super.installEnvironment(sourceType, targetType); + + //create the target + CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint()); + requestcreation.setLocation(DEFAULT_SOURCE_LOCATION); + Command command = parent.getCommand(requestcreation); + assertTrue(command.canExecute()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + + // FIXME : get(0) : header; get(1) : container + List<GraphicalEditPart> children = parent.getChildren(); + target = (GraphicalEditPart)children.get(3); + } + + /** + * Init the configuration for a link owned by the parent. (Connector) + */ + protected void initConfLinkOwnedByParent(){ + // expected values before link creation + beginRootSemanticOwnedElementSize = 1; + beginDiagramEditPartChildrenSize = 1; + beginRootEdgeSize = 0; + beginSourceConnectionsSize = 0; + beginRootViewChildrenSize = 1; + // expected values after link creation + endSourceConnectionsSize = beginSourceConnectionsSize + 1; + endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize; + endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize; + endRootEdgeSize = beginRootEdgeSize+1; + endRootViewChildrenSize = beginRootViewChildrenSize; + } + + + /** + * Init the configuration for a link owned by the root. (Usage) + */ + protected void initConfLinkOwnedByDiagram(){ + // expected values before link creation + beginRootSemanticOwnedElementSize = 1; + beginDiagramEditPartChildrenSize = 1; + beginRootEdgeSize = 0; + beginSourceConnectionsSize = 0; + beginRootViewChildrenSize = 1; + // expected values after link creation + endSourceConnectionsSize = beginSourceConnectionsSize + 1; + endRootSemanticOwnedElementSize = beginRootSemanticOwnedElementSize + 1; + endDiagramEditPartChildrenSize = beginDiagramEditPartChildrenSize; + endRootEdgeSize = beginRootEdgeSize + 1; + endRootViewChildrenSize = beginRootViewChildrenSize; + } + + /** + * Test to manage port connector. + */ + @Test + public void testToManagePortConnector() { + initConfLinkOwnedByParent(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Connector_4013, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port usage. + */ + @Test + public void testToManagePortUsage() { + initConfLinkOwnedByDiagram(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Usage_4008, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port abstraction. + */ + @Test + public void testToManagePortAbstraction() { + initConfLinkOwnedByDiagram(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Abstraction_4007, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port substitution. + */ + @Test + public void testToManagePortSubstitution() { + initConfLinkOwnedByDiagram(); + testToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Substitution_4011, UMLElementTypes.Class_2073, true); + } + + /** + * Test to manage port generalization. + */ + @Test + public void testToManagePortGeneralization() { + testImpossibleToManageLink(UMLElementTypes.Port_3069, UMLElementTypes.Port_3069, UMLElementTypes.Generalization_4015); + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramLinkOwnedBySource.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramLinkOwnedBySource.java new file mode 100644 index 00000000000..42f4cd4a9e3 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramLinkOwnedBySource.java @@ -0,0 +1,86 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test.canonical; + +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.diagram.tests.canonical.TestLinkOwnedBySource; +import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand; +import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes; +import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants; +import org.junit.Test; + +/** + * The Class TestCompositeDiagramLinkOwnedBySource use to test link that are contained by the owner of the target and the source. + */ +public class TestCompositeDiagramLinkOwnedBySource extends TestLinkOwnedBySource { + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation() + * + * @return + */ + + @Override + protected ICreationCommand getDiagramCommandCreation() { + return new CreateCompositeDiagramCommand(); + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName() + * + * @return + */ + + @Override + protected String getProjectName() { + return ICompositeDiagramTestsConstants.PROJECT_NAME; + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName() + * + * @return + */ + + @Override + protected String getFileName() { + return ICompositeDiagramTestsConstants.FILE_NAME; + } + + /** + * Test to manage generalization. + */ + @Test + public void testToManageGeneralization() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Generalization_4015, UMLElementTypes.Package_1000, true); + } + + + /** + * Test class to collaboration generalization. + */ + @Test + public void testClassToCollaborationGeneralization() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Collaboration_2075, UMLElementTypes.Generalization_4015, UMLElementTypes.Package_1000, true); + } + + /** + * Test collaboration to class generalization. + */ + @Test + public void testCollaborationToClassGeneralization() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Class_2073, UMLElementTypes.Generalization_4015, UMLElementTypes.Package_1000, true); + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramSimpleLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramSimpleLink.java new file mode 100644 index 00000000000..e8214978058 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/canonical/TestCompositeDiagramSimpleLink.java @@ -0,0 +1,228 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.composite.test.canonical; + +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.diagram.tests.canonical.TestLink; +import org.eclipse.papyrus.uml.diagram.composite.CreateCompositeDiagramCommand; +import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes; +import org.eclipse.papyrus.uml.diagram.composite.test.ICompositeDiagramTestsConstants; +import org.junit.Test; + +/** + * The Class TestCompositeDiagramLink use to test link. + */ +public class TestCompositeDiagramSimpleLink extends TestLink { + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getDiagramCommandCreation() + * + * @return + */ + + @Override + protected ICreationCommand getDiagramCommandCreation() { + return new CreateCompositeDiagramCommand(); + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getProjectName() + * + * @return + */ + + @Override + protected String getProjectName() { + return ICompositeDiagramTestsConstants.PROJECT_NAME; + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.AbstractPapyrusTestCase#getFileName() + * + * @return + */ + + @Override + protected String getFileName() { + return ICompositeDiagramTestsConstants.FILE_NAME; + } + + + /** + * Test to manage class usage. + */ + @Test + public void testToManageClassUsage() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Usage_4008, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage class substitution. + */ + @Test + public void testToManageClassSubstitution() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Substitution_4011, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage class dependency. + */ + @Test + public void testToManageClassDependency() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Dependency_4010, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage class abstraction. + */ + @Test + public void testToManageClassAbstraction() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Abstraction_4007, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage class realization. + */ + @Test + public void testToManageClassRealization() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Realization_4006, UMLElementTypes.Package_1000, true); + } + + // Activity + /** + * Test to manage activity usage. + */ + @Test + public void testToManageActivityUsage() { + testToManageLink(UMLElementTypes.Activity_2060, UMLElementTypes.Activity_2060, UMLElementTypes.Usage_4008, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage activity substitution. + */ + @Test + public void testToManageActivitySubstitution() { + testToManageLink(UMLElementTypes.Activity_2060, UMLElementTypes.Activity_2060, UMLElementTypes.Substitution_4011, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage activity dependency. + */ + @Test + public void testToManageActivityDependency() { + testToManageLink(UMLElementTypes.Activity_2060, UMLElementTypes.Activity_2060, UMLElementTypes.Dependency_4010, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage activity abstraction. + */ + @Test + public void testToManageActivityAbstraction() { + testToManageLink(UMLElementTypes.Activity_2060, UMLElementTypes.Activity_2060, UMLElementTypes.Abstraction_4007, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage activity realization. + */ + @Test + public void testToManageActivityRealization() { + testToManageLink(UMLElementTypes.Activity_2060, UMLElementTypes.Activity_2060, UMLElementTypes.Realization_4006, UMLElementTypes.Package_1000, true); + } + + + // State Machine + /** + * Test to manage state machine usage. + */ + @Test + public void testToManageStateMachineUsage() { + testToManageLink(UMLElementTypes.StateMachine_2063, UMLElementTypes.StateMachine_2063, UMLElementTypes.Usage_4008, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage state machine substitution. + */ + @Test + public void testToManageStateMachineSubstitution() { + testToManageLink(UMLElementTypes.StateMachine_2063, UMLElementTypes.StateMachine_2063, UMLElementTypes.Substitution_4011, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage state machine dependency. + */ + @Test + public void testToManageStateMachineDependency() { + testToManageLink(UMLElementTypes.StateMachine_2063, UMLElementTypes.StateMachine_2063, UMLElementTypes.Dependency_4010, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage state machine abstraction. + */ + @Test + public void testToManageStateMachineAbstraction() { + testToManageLink(UMLElementTypes.StateMachine_2063, UMLElementTypes.StateMachine_2063, UMLElementTypes.Abstraction_4007, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage state machine realization. + */ + @Test + public void testToManageStateMachineRealization() { + testToManageLink(UMLElementTypes.Class_2073, UMLElementTypes.Class_2073, UMLElementTypes.Realization_4006, UMLElementTypes.Package_1000, true); + } + + + // Collaboration + /** + * Test to manage collaboration usage. + */ + @Test + public void testToManageCollaborationUsage() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Collaboration_2075, UMLElementTypes.Usage_4008, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage collaboration substitution. + */ + @Test + public void testToManageCollaborationSubstitution() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Collaboration_2075, UMLElementTypes.Substitution_4011, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage collaboration dependency. + */ + @Test + public void testToManageCollaborationDependency() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Collaboration_2075, UMLElementTypes.Dependency_4010, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage collaboration abstraction. + */ + @Test + public void testToManageCollaborationAbstraction() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Collaboration_2075, UMLElementTypes.Abstraction_4007, UMLElementTypes.Package_1000, true); + } + + /** + * Test to manage collaboration realization. + */ + @Test + public void testToManageCollaborationRealization() { + testToManageLink(UMLElementTypes.Collaboration_2075, UMLElementTypes.Collaboration_2075, UMLElementTypes.Realization_4006, UMLElementTypes.Package_1000, true); + } + + +} diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkWithParent.java b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkWithParent.java new file mode 100644 index 00000000000..be73c0904a5 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.diagram.tests/src/org/eclipse/papyrus/diagram/tests/canonical/TestLinkWithParent.java @@ -0,0 +1,381 @@ +/***************************************************************************** + * Copyright (c) 2014 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: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.diagram.tests.canonical; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.gef.ConnectionEditPart; +import org.eclipse.gef.Request; +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.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.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Element; + +/** + * The Class TestLinkWithParent use to test link between elements with parent. + */ +public abstract class TestLinkWithParent extends TestLink { + + + /** The Constant DEFAULT_DROP_LOCATION. */ + protected static final Point DEFAULT_DROP_LOCATION = new Point(20, 20); + + /** The default source location. */ + protected static Point DEFAULT_SOURCE_LOCATION = new Point(300, 100); + + /** The default parent location. */ + protected static Point DEFAULT_PARENT_LOCATION = new Point(100, 100); + + // dyn values + + /** The begin root semantic owned element size. */ + protected int beginRootSemanticOwnedElementSize; + + /** The end root semantic owned element size. */ + protected int endRootSemanticOwnedElementSize; + + /** The begin diagram edit part children size. */ + protected int beginDiagramEditPartChildrenSize; + + /** The end diagram edit part children size. */ + protected int endDiagramEditPartChildrenSize; + + /** The begin root edge size. */ + protected int beginRootEdgeSize; + + /** The end root edge size. */ + protected int endRootEdgeSize; + + /** The begin source connections size. */ + protected int beginSourceConnectionsSize; + + /** The end source connections size. */ + protected int endSourceConnectionsSize; + + /** The begin root view children size. */ + protected int beginRootViewChildrenSize; + + /** The end root view children size. */ + protected int endRootViewChildrenSize; + + /** The parent type. */ + public IElementType parentType; + + /** The parent. */ + public GraphicalEditPart parent; + + /** The link element. */ + private Element linkElement; + + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#installEnvironment(org.eclipse.gmf.runtime.emf.type.core.IElementType, + * org.eclipse.gmf.runtime.emf.type.core.IElementType) + * + * @param sourceType + * @param targetType + */ + + @Override + public void installEnvironment(IElementType sourceType, IElementType targetType) { + + //create the parent source + CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(parentType, getDiagramEditPart().getDiagramPreferencesHint()); + requestcreation.setLocation(DEFAULT_PARENT_LOCATION); + Command command = getDiagramEditPart().getCommand(requestcreation); + assertTrue(command.canExecute()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);; + parent = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0); + + //create the source + requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint()); + requestcreation.setLocation(DEFAULT_SOURCE_LOCATION); + command = parent.getCommand(requestcreation); + assertTrue(command.canExecute()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + // FIXME : get(0) : header; get(1) : container + List<GraphicalEditPart> children = parent.getChildren(); + source = (GraphicalEditPart)children.get(2); + } + + + + /** + * Check that the link is impossible to create + * + * @param sourceType + * the source type + * @param targetType + * the target type + * @param linkType + * the link type + */ + public void testImpossibleToManageLink(IElementType sourceType, IElementType targetType, IElementType linkType) { + installEnvironment(sourceType, targetType); + Command command = target.getCommand(createConnectionViewRequest(linkType, source, target)); + assertFalse(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command != null && command.canExecute()); + } + + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#testToManageLink(org.eclipse.gmf.runtime.emf.type.core.IElementType, + * org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.gmf.runtime.emf.type.core.IElementType, + * org.eclipse.gmf.runtime.emf.type.core.IElementType, boolean) + * + * @param sourceType + * @param targetType + * @param linkType + * @param containerType + * @param allowedOntheSame + */ + + @Override + public void testToManageLink(IElementType sourceType, IElementType targetType, IElementType linkType, IElementType containerType, boolean allowedOntheSame) { + installEnvironment(sourceType, targetType); + testToCreateALink(linkType); + testDestroy(linkType); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + testViewDeletion(linkType); + testDrop(linkType); + // destroy the element + Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false)); + Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + // test link on the same + testToCreateAlinkOnTheSame(linkType, allowedOntheSame); + + if(allowedOntheSame) { + + ConnectionEditPart graphicalEditPart = (ConnectionEditPart)source.getSourceConnections().get(0); + View view = (View)graphicalEditPart.getModel(); + linkElement = (Element)view.getElement(); + + deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE); + command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest); + assertNotNull(VIEW_DELETION + COMMAND_NULL, command); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + testToDropAlinkOnTheSame(linkType, allowedOntheSame); + } + + + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#testToCreateALink(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * + * @param linkType + */ + + @Override + public void testToCreateALink(IElementType linkType) { + assertEquals(CREATION + INITIALIZATION_TEST, beginDiagramEditPartChildrenSize, getDiagramEditPart().getChildren().size()); + assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == beginRootSemanticOwnedElementSize); + assertTrue(CREATION + INITIALIZATION_TEST, source.getSourceConnections().size() == beginSourceConnectionsSize); + Command command = target.getCommand(createConnectionViewRequest(linkType, source, target)); + assertNotNull(CREATION + COMMAND_NULL, command); + assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertTrue(CREATION + INITIALIZATION_TEST, source.getSourceConnections().size() == endSourceConnectionsSize); + ConnectionEditPart graphicalEditPart = (ConnectionEditPart)source.getSourceConnections().get(0); + View view = (View)graphicalEditPart.getModel(); + linkElement = (Element)view.getElement(); + assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + assertEquals(CREATION + INITIALIZATION_TEST, endRootSemanticOwnedElementSize, getRootSemanticModel().getOwnedElements().size()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertEquals(CREATION + TEST_THE_UNDO, endRootViewChildrenSize, getRootView().getChildren().size()); + assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == beginRootSemanticOwnedElementSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#testDestroy(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * + * @param type + */ + + @Override + public void testDestroy(IElementType type) { // BMA : FIXME : unused param + //DESTROY SEMANTIC+ VIEW + assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == endSourceConnectionsSize); + assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false)); + Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest); + assertNotNull(DESTROY_DELETION + COMMAND_NULL, command); + assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == beginSourceConnectionsSize); + assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == beginRootSemanticOwnedElementSize); + assertTrue(DESTROY_DELETION + TEST_THE_UNDO, diagramEditor.getDiagramEditDomain().getDiagramCommandStack().canUndo() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertTrue(DESTROY_DELETION + TEST_THE_UNDO, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + assertTrue(DESTROY_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == endSourceConnectionsSize); + assertTrue(DESTROY_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + assertTrue(DESTROY_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == beginSourceConnectionsSize); + assertTrue(DESTROY_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == beginRootSemanticOwnedElementSize); + } + + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#testViewDeletion(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * + * @param type + */ + + @Override + public void testViewDeletion(IElementType type) { // BMA : FIXME : unused param + //DELETION OF THE VIEW + assertTrue(VIEW_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == endSourceConnectionsSize); + assertTrue(VIEW_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE); + Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest); + assertNotNull(VIEW_DELETION + COMMAND_NULL, command); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == beginSourceConnectionsSize); + assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertTrue(VIEW_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == endSourceConnectionsSize); + assertTrue(VIEW_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertTrue(VIEW_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == beginSourceConnectionsSize); + assertTrue(VIEW_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + } + + /** + * @see org.eclipse.papyrus.diagram.tests.canonical.TestLink#testDrop(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * + * @param type + */ + + @Override + public void testDrop(IElementType type) {// BMA : FIXME : unused param + //DROP + assertTrue(DROP + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == beginDiagramEditPartChildrenSize); + assertTrue(DROP + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + DropObjectsRequest dropObjectsRequest = new DropObjectsRequest(); + List<Element> list = new ArrayList<Element>(); + list.add(linkElement); + dropObjectsRequest.setObjects(list); + dropObjectsRequest.setLocation(DEFAULT_DROP_LOCATION); + Command command = getDiagramEditPart().getCommand(dropObjectsRequest); + assertNotNull(DROP + COMMAND_NULL, command); + assertTrue(DROP + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(DROP + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertTrue(DROP + TEST_THE_EXECUTION, getDiagramEditPart().getChildren().size() == endDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertTrue(DROP + TEST_THE_UNDO, getDiagramEditPart().getChildren().size() == beginDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_UNDO, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertTrue(DROP + TEST_THE_REDO, getDiagramEditPart().getChildren().size() == endDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + } + + + + /** + * test the drop of a link where the source and the target are the same objects. + * + * @param linkType + * the link type + * @param allowed + * the allowed + */ + @Override + protected void testToDropAlinkOnTheSame(IElementType linkType, boolean allowed) { + //DROP + if(allowed) { + assertTrue(DROP + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == beginDiagramEditPartChildrenSize); + assertTrue(DROP + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + DropObjectsRequest dropObjectsRequest = new DropObjectsRequest(); + List<Element> list = new ArrayList<Element>(); + list.add(linkElement); + dropObjectsRequest.setObjects(list); + dropObjectsRequest.setLocation(DEFAULT_DROP_LOCATION); + Command command = getDiagramEditPart().getCommand(dropObjectsRequest); + assertNotNull(DROP + COMMAND_NULL, command); + assertTrue(DROP + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE); + assertTrue(DROP + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertTrue(DROP + TEST_THE_EXECUTION, getDiagramEditPart().getChildren().size() == endDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertTrue(DROP + TEST_THE_UNDO, getDiagramEditPart().getChildren().size() == beginDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_UNDO, ((Diagram)getRootView()).getEdges().size() == beginRootEdgeSize); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertTrue(DROP + TEST_THE_REDO, getDiagramEditPart().getChildren().size() == endDiagramEditPartChildrenSize); + assertTrue(DROP + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == endRootSemanticOwnedElementSize); + assertTrue(DROP + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == endRootEdgeSize); + } + } + + /** + * test the creation of a link where the source and the target are the same objects. + * + * @param linkType + * the link type + * @param allowed + * the allowed + */ + @Override + protected void testToCreateAlinkOnTheSame(IElementType linkType, boolean allowed) { + assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == beginDiagramEditPartChildrenSize); + assertEquals(CREATION + INITIALIZATION_TEST, beginRootSemanticOwnedElementSize, getRootSemanticModel().getOwnedElements().size()); + Command command = target.getCommand(createConnectionViewRequest(linkType, source, source)); + assertNotNull(CREATION + COMMAND_NULL, command); + assertEquals(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute(), allowed); + if(allowed) { + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command); + assertEquals(CREATION + INITIALIZATION_TEST, endRootEdgeSize, ((Diagram)getRootView()).getEdges().size()); + assertEquals(CREATION + INITIALIZATION_TEST, endRootSemanticOwnedElementSize, getRootSemanticModel().getOwnedElements().size()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo(); + assertEquals(CREATION + TEST_THE_UNDO, beginRootViewChildrenSize, getRootView().getChildren().size()); + assertEquals(CREATION + TEST_THE_UNDO, beginRootSemanticOwnedElementSize, getRootSemanticModel().getOwnedElements().size()); + diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo(); + assertEquals(CREATION + TEST_THE_REDO, endRootEdgeSize, ((Diagram)getRootView()).getEdges().size()); + assertEquals(CREATION + TEST_THE_REDO, endRootSemanticOwnedElementSize, getRootSemanticModel().getOwnedElements().size()); + } + } + +} |