Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorytanguy2012-03-16 12:33:55 +0000
committerytanguy2012-03-16 12:33:55 +0000
commitfafb02b8e6c93e49afa3f61b3f709f2f9a73e7c4 (patch)
tree0cfd63c3df50080e113dc1dddcafef2ebf24ac28 /tests
parent1f5eef7e350a6debc346072dbff95210febc7e39 (diff)
downloadorg.eclipse.papyrus-fafb02b8e6c93e49afa3f61b3f709f2f9a73e7c4.tar.gz
org.eclipse.papyrus-fafb02b8e6c93e49afa3f61b3f709f2f9a73e7c4.tar.xz
org.eclipse.papyrus-fafb02b8e6c93e49afa3f61b3f709f2f9a73e7c4.zip
372355: [SysML Internal Block Diagram] JUnit tests for the Internal Block Diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372355
Diffstat (limited to 'tests')
-rw-r--r--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.java139
-rw-r--r--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.java125
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java89
-rw-r--r--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.java96
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java89
-rw-r--r--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.java96
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--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.java82
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationConnectorWithDelegateTests.java59
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationLinkTests.java1
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java33
21 files changed, 1711 insertions, 0 deletions
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
new file mode 100644
index 00000000000..b5e332f5687
--- /dev/null
+++ 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
@@ -0,0 +1,139 @@
+/*****************************************************************************
+ * 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 = actorPartTargetView;
+ createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedActorPart() throws Exception {
+ View targetView = nestedActorPartTargetView;
+ 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 = portOnPartTargetView;
+ createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourcePortOnNestedPart() throws Exception {
+ View targetView = portOnNestedPartTargetView;
+ 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 = flowportOnPartTargetView;
+ createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceFlowPortOnNestedPart() throws Exception {
+ View targetView = flowportOnNestedPartTargetView;
+ 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 = nestedPartTargetView;
+ 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
new file mode 100644
index 00000000000..3ac7f657597
--- /dev/null
+++ 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
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * 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 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;
+
+ 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 View nestedPartContainer1;
+ public static View nestedPartContainer2;
+
+ public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
+
+ @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);
+ partContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
+ View partStructureView = ViewUtil.getChildBySemanticHint(partContainer1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
+ partContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
+ nestedPartContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedPartContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+
+ // Prepare elements for link creation tests
+
+ blockSourceView = container;
+ blockTargetView = container;
+
+ // Prepare child nodes
+
+ 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_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedActorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+
+ // 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.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer1);
+ portOnNestedPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer2);
+
+ 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.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer1);
+ flowportOnNestedPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer2);
+
+ 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_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedPartTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+
+ 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_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+
+ 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_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+
+ 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_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_NESTEDBLOCKPROPERTY_AS_COMPOSITE_ID, partStructureView);
+ }
+}
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
new file mode 100644
index 00000000000..8b5f8ebecaa
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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 = actorPartSourceView;
+ }
+
+ @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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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/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
new file mode 100644
index 00000000000..073d4301af0
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..0a9eb28080f
--- /dev/null
+++ 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
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ * 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 = flowportOnNestedPartSourceView;
+ }
+
+ @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(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)nestedPartContainer1.getElement();
+
+ Property targetpart = (Property)partContainer2.getElement();
+ Property targetNestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ for (View view : isCreationAllowed.keySet()) {
+ expectedSourcePartWithPort.put(view, sourceNestedpart);
+ }
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, targetpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, targetpart);
+
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, targetNestedpart);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..d195ae5fd75
--- /dev/null
+++ 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
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * 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 = flowportOnPartSourceView;
+ }
+
+ @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(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)partContainer1.getElement();
+ Property part2 = (Property)partContainer2.getElement();
+ Property nestedPart2 = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ for (View view : isCreationAllowed.keySet()) {
+ expectedSourcePartWithPort.put(view, part1);
+ }
+
+ expectedSourcePartWithPort.remove(portOnNestedPartTargetView);
+ expectedSourcePartWithPort.remove(flowportOnNestedPartTargetView);
+ expectedSourcePartWithPort.remove(nestedActorPartTargetView);
+ expectedSourcePartWithPort.remove(nestedPartTargetView);
+ expectedSourcePartWithPort.remove(nestedPropertyTargetView);
+ expectedSourcePartWithPort.remove(nestedReferenceTargetView);
+ expectedSourcePartWithPort.remove(nestedValueTargetView);
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part2);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part2);
+
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedPart2);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..c325f22ead7
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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 = nestedActorPartSourceView;
+ }
+
+ @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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..901252bc7d1
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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 = nestedPartSourceView;
+ }
+
+ @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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..b29a58b29c1
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..0129f26200c
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..53c0d5b143d
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..0e1dc355b7f
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..c27f16743b6
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..717e7845805
--- /dev/null
+++ 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
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ * 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 = portOnNestedPartSourceView;
+ }
+
+ @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(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)nestedPartContainer1.getElement();
+
+ Property targetpart = (Property)partContainer2.getElement();
+ Property targetNestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ for (View view : isCreationAllowed.keySet()) {
+ expectedSourcePartWithPort.put(view, sourceNestedpart);
+ }
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, targetpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, targetpart);
+
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, targetNestedpart);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..f1bc6c8ab12
--- /dev/null
+++ 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
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * 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 = portOnPartSourceView;
+ }
+
+ @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(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)partContainer1.getElement();
+ Property part2 = (Property)partContainer2.getElement();
+ Property nestedPart2 = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ for (View view : isCreationAllowed.keySet()) {
+ expectedSourcePartWithPort.put(view, part1);
+ }
+
+ expectedSourcePartWithPort.remove(portOnNestedPartTargetView);
+ expectedSourcePartWithPort.remove(flowportOnNestedPartTargetView);
+ expectedSourcePartWithPort.remove(nestedActorPartTargetView);
+ expectedSourcePartWithPort.remove(nestedPartTargetView);
+ expectedSourcePartWithPort.remove(nestedPropertyTargetView);
+ expectedSourcePartWithPort.remove(nestedReferenceTargetView);
+ expectedSourcePartWithPort.remove(nestedValueTargetView);
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part2);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part2);
+
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedPart2);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..ea4ecb24d53
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..0044023200f
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, 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
new file mode 100644
index 00000000000..04367b8122a
--- /dev/null
+++ 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
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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(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(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)partContainer2.getElement();
+ Property nestedpart = (Property)nestedPartContainer2.getElement();
+
+ expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
+ expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
+
+ expectedTargetPartWithPort.put(portOnPartTargetView, part);
+ expectedTargetPartWithPort.put(portOnNestedPartTargetView, nestedpart);
+ expectedTargetPartWithPort.put(flowportOnPartTargetView, part);
+ expectedTargetPartWithPort.put(flowportOnNestedPartTargetView, nestedpart);
+ }
+
+}
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationConnectorWithDelegateTests.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationConnectorWithDelegateTests.java
new file mode 100644
index 00000000000..f3f9bceaa4b
--- /dev/null
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationConnectorWithDelegateTests.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * 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.suites;
+
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromActorPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromFlowPortOnBlock;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromFlowPortOnNestedPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromFlowPortOnPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromNestedActorPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromNestedPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromNestedProperty;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromNestedReference;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromNestedValue;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromPortOnBlock;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromPortOnNestedPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromPortOnPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromProperty;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromReference;
+import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation.TestCreationAndTestDelegateFromValue;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+
+ TestCreationAndTestDelegateFromActorPart.class,
+ TestCreationAndTestDelegateFromFlowPortOnBlock.class,
+ TestCreationAndTestDelegateFromFlowPortOnNestedPart.class,
+ TestCreationAndTestDelegateFromFlowPortOnPart.class,
+ TestCreationAndTestDelegateFromNestedActorPart.class,
+ TestCreationAndTestDelegateFromNestedPart.class,
+ TestCreationAndTestDelegateFromNestedProperty.class,
+ TestCreationAndTestDelegateFromNestedReference.class,
+ TestCreationAndTestDelegateFromNestedValue.class,
+ TestCreationAndTestDelegateFromPortOnBlock.class,
+ TestCreationAndTestDelegateFromPortOnNestedPart.class,
+ TestCreationAndTestDelegateFromPortOnPart.class,
+ TestCreationAndTestDelegateFromPart.class,
+ TestCreationAndTestDelegateFromProperty.class,
+ TestCreationAndTestDelegateFromReference.class,
+ TestCreationAndTestDelegateFromValue.class
+
+ })
+public class AllCreationConnectorWithDelegateTests {
+
+}
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationLinkTests.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationLinkTests.java
index a4c46df69c6..9e82cee2cf8 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationLinkTests.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/suites/AllCreationLinkTests.java
@@ -21,6 +21,7 @@ import org.junit.runners.Suite.SuiteClasses;
@SuiteClasses({
AllCreationConnectorTests.class,
+ AllCreationConnectorWithDelegateTests.class,
AllCreationConnectorWithEncapsulatedPartTests.class,
AllCreationDependencyTests.class,
AllCreationInheritedLinkTests.class,
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
index 3855d7e89b9..0274aaeb60b 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
@@ -78,6 +78,7 @@ import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.uml2.uml.ConnectableElement;
import org.eclipse.uml2.uml.ConnectorEnd;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Property;
@@ -479,6 +480,38 @@ public class TestUtils {
}
}
+ public static void createEdgeConnectorAndTestDelegateFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
+ createEdgeConnectorAndTestDelegateFromPalette(toolId, sourceView, targetView, isAllowed, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
+ }
+
+ public static void createEdgeConnectorAndTestDelegateFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
+ EObject newLink = createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, execute);
+
+ // Abort if the command is not supposed to be executable
+ if(!isAllowed) {
+ return;
+ }
+
+ if((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
+ fail("No edge or unexpected kind of edge created.");
+ }
+
+ // If previous test have not failed the execution / undo / re-do has been done
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)newLink;
+
+ // Test source connector end
+ ConnectorEnd sourceConnectorEnd = connector.getEnds().get(0);
+ if(sourceConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
+ fail("The partWithPort is incorrect for source.");
+ }
+
+ // Test target connector end
+ ConnectorEnd targetConnectorEnd = connector.getEnds().get(1);
+ if(targetConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
+ fail("The partWithPort is incorrect for target.");
+ }
+ }
+
public static void reorientRelationshipSource(View relationshipView, View newSourceView, boolean isAllowed) throws Exception {
reorientRelationship((Connector)relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed);
}

Back to the top