diff options
Diffstat (limited to 'tests/junit/plugins')
24 files changed, 2559 insertions, 2480 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/AbstractLinkPrepareTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java index 342ceb4d0ed..90dba9fc01c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java @@ -1,261 +1,261 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView;
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for link creation test (via palette tools).
- */
-public class AbstractLinkPrepareTest extends AbstractTest {
-
- public static String toolID;
-
- // Custom nodes
- public static View blockSourceView, blockTargetView;
-
- // Custom child label nodes
- public static View actorPartSourceView, actorPartTargetView;
- public static View nestedActorPartSourceView, nestedActorPartTargetView;
- public static View portOnBlockSourceView, portOnBlockTargetView;
- public static View portOnPartSourceView, portOnPartTargetView;
- public static View portOnNestedPartSourceView, portOnNestedPartTargetView;
- public static View flowportOnBlockSourceView, flowportOnBlockTargetView;
- public static View flowportOnPartSourceView, flowportOnPartTargetView;
- public static View flowportOnNestedPartSourceView, flowportOnNestedPartTargetView;
- public static View partSourceView, partTargetView;
- public static View nestedPartSourceView, nestedPartTargetView;
- public static View propertySourceView, propertyTargetView;
- public static View nestedPropertySourceView, nestedPropertyTargetView;
- public static View referenceSourceView, referenceTargetView;
- public static View nestedReferenceSourceView, nestedReferenceTargetView;
- public static View valueSourceView, valueTargetView;
- public static View nestedValueSourceView, nestedValueTargetView;
-
- // Inherited nodes
- public static View commentSourceView, commentTargetView, commentCNSourceView, commentCNTargetView;
- public static View constraintSourceView, constraintTargetView, constraintCNSourceView, constraintCNTargetView;
-
- public static View partContainer1; // Its type block may be set encapsulated for testing purpose.
- public static View partContainer2; // Its type block may be set encapsulated for testing purpose.
-
- public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
-
- public static View subNestedActorPartContainer1_1_1SourceView;
-
- public static View subNestedActorPartContainer1_1_1TargetView;
-
- public static View portOnSubNestedPartSourceView;
-
- public static View portOnSubNestedPartTargetView;
-
- public static View flowportOnSubNestedPartSourceView;
-
- public static View flowportOnSubNestedPartTargetView;
-
- public static View portOnSubNestedPartContainer1_1_1SourceView;
-
- public static View portOnSubNestedPartContainer2_1_1TargetView;
-
- public static View portOnSubNestedPartContainer1_1_2TargetView;
-
- public static View flowportOnSubNestedPartContainer1_1_1SourceView;
-
- public static View flowportOnSubNestedPartContainer2_1_1TargetView;
-
- public static View portOnSubNestedPartContainer2SourceView;
-
- public static View portOnSubNestedPartContainer1_2_1TargetView;
-
- public static View flowportOnSubNestedPartContainer1_2_1TargetView;
-
- public static View flowportOnSubNestedPartContainer1_1_2TargetView;
-
- public static View subNestedPartContainer1_1_1SourceView;
-
- public static View subNestedPartContainer1_2_1TargetView;
-
- public static View subNestedPartContainer1_1_1TargetView;
-
- public static View subNestedPartContainer1_1_2TargetView;
-
- public static View subNestedPropertyContainer1_1_1SourceView;
-
- public static View subNestedPropertyContainer1_1_1TargetView;
-
- public static View subNestedPropertyContainer1_2_1TargetView;
-
- public static View subNestedPropertyContainer1_1_2TargetView;
-
- public static View subNestedReferenceContainer1_1_1SourceView;
-
- public static View subNestedReferenceContainer1_1_1TargetView;
-
- public static View subNestedReferenceContainer1_2_1TargetView;
-
- public static View subNestedReferenceContainer1_1_2TargetView;
-
- public static View subNestedValueContainer1_1_1SourceView;
-
- public static View subNestedValueContainer1_1_1TargetView, subNestedValueContainer1_2_1TargetView, subNestedValueContainer1_1_2TargetView;
-
- public static View subNestedActorPartContainer1_2_1TargetView;
-
- public static View subNestedActorPartContainer1_1_2TargetView;
-
- public static View nestedPartContainer1_1;
-
- public static View nestedPartContainer2_1;
-
- public static View nestedPartContainer1_2;
-
- @BeforeClass
- public static void prepareInheritedNodes() throws Exception {
- View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View containerCpt = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
-
- // Prepare elements for link creation tests
- commentSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
- commentTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
- commentCNSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt);
- commentCNTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt);
-
- constraintSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
- constraintTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
- constraintCNSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt);
- constraintCNTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt);
- }
-
- @BeforeClass
- public static void prepareCustomNodes() throws Exception {
- View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View blockStructureView = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
- // part in block (level = 1)
- partContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View partContainer1StructureView = ViewUtil.getChildBySemanticHint(partContainer1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- partContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View partContainer2StructureView = ViewUtil.getChildBySemanticHint(partContainer2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
-
- nestedPartContainer1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- View nestedPartContainer1_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- nestedPartContainer2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- View nestedPartContainer2_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer2_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- nestedPartContainer1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer2StructureView);
- View nestedPartContainer1_2StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // nested container in nested part (level = 3)
- View subNestedPartContainer1_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView);
- View subNestedPartContainer2_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView);
-
- // nested container in nestedPartContainer2_1 (level = 3)
- View subNestedPartContainer1_2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1StructureView);
-
- // nested container in nestedPartContainer1_2StructureView (level = 3)
- View subNestedPartContainer1_1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2StructureView);
-
-
- // Prepare elements for link creation tests
-
- blockSourceView = container;
- blockTargetView = container;
-
- // Prepare child nodes
-
- partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPartSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedPartTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- // Port & FlowPorts no distinction made on FlowPorts kind...
- portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container);
- portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container);
- portOnPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer1);
- portOnPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer2);
- portOnNestedPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer1_1);
- portOnNestedPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer2_1);
- portOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView);
- portOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1);
- portOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1);
- portOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2);
-
- flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container);
- flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container);
- flowportOnPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer1);
- flowportOnPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer2);
- flowportOnNestedPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer1_1);
- flowportOnNestedPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer2_1);
- flowportOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView);
- flowportOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1);
- flowportOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1);
- flowportOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2);
-
- propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedPropertyContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPropertyContainer1_1_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedPropertyContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedPropertyContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedReferenceContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedReferenceContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedReferenceContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedReferenceContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
-
- valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedValueContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedValueContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedValueContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedValueContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
-
- actorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedActorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- nestedActorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView);
- subNestedActorPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedActorPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1);
- subNestedActorPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1);
- subNestedActorPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2);
- }
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView; +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; +import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.BeforeClass; + +/** + * JUnit tests for link creation test (via palette tools). + */ +public abstract class AbstractLinkPrepareTest extends AbstractTest { + + public static String toolID; + + // Custom nodes + public static View blockSourceView, blockTargetView; + + // Custom child label nodes + public static View actorPartSourceView, actorPartTargetView; + public static View nestedActorPartSourceView, nestedActorPartTargetView; + public static View portOnBlockSourceView, portOnBlockTargetView; + public static View portOnPartSourceView, portOnPartTargetView; + public static View portOnNestedPartSourceView, portOnNestedPartTargetView; + public static View flowportOnBlockSourceView, flowportOnBlockTargetView; + public static View flowportOnPartSourceView, flowportOnPartTargetView; + public static View flowportOnNestedPartSourceView, flowportOnNestedPartTargetView; + public static View partSourceView, partTargetView; + public static View nestedPartSourceView, nestedPartTargetView; + public static View propertySourceView, propertyTargetView; + public static View nestedPropertySourceView, nestedPropertyTargetView; + public static View referenceSourceView, referenceTargetView; + public static View nestedReferenceSourceView, nestedReferenceTargetView; + public static View valueSourceView, valueTargetView; + public static View nestedValueSourceView, nestedValueTargetView; + + // Inherited nodes + public static View commentSourceView, commentTargetView, commentCNSourceView, commentCNTargetView; + public static View constraintSourceView, constraintTargetView, constraintCNSourceView, constraintCNTargetView; + + public static View partContainer1; // Its type block may be set encapsulated for testing purpose. + public static View partContainer2; // Its type block may be set encapsulated for testing purpose. + + public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>(); + + public static View subNestedActorPartContainer1_1_1SourceView; + + public static View subNestedActorPartContainer1_1_1TargetView; + + public static View portOnSubNestedPartSourceView; + + public static View portOnSubNestedPartTargetView; + + public static View flowportOnSubNestedPartSourceView; + + public static View flowportOnSubNestedPartTargetView; + + public static View portOnSubNestedPartContainer1_1_1SourceView; + + public static View portOnSubNestedPartContainer2_1_1TargetView; + + public static View portOnSubNestedPartContainer1_1_2TargetView; + + public static View flowportOnSubNestedPartContainer1_1_1SourceView; + + public static View flowportOnSubNestedPartContainer2_1_1TargetView; + + public static View portOnSubNestedPartContainer2SourceView; + + public static View portOnSubNestedPartContainer1_2_1TargetView; + + public static View flowportOnSubNestedPartContainer1_2_1TargetView; + + public static View flowportOnSubNestedPartContainer1_1_2TargetView; + + public static View subNestedPartContainer1_1_1SourceView; + + public static View subNestedPartContainer1_2_1TargetView; + + public static View subNestedPartContainer1_1_1TargetView; + + public static View subNestedPartContainer1_1_2TargetView; + + public static View subNestedPropertyContainer1_1_1SourceView; + + public static View subNestedPropertyContainer1_1_1TargetView; + + public static View subNestedPropertyContainer1_2_1TargetView; + + public static View subNestedPropertyContainer1_1_2TargetView; + + public static View subNestedReferenceContainer1_1_1SourceView; + + public static View subNestedReferenceContainer1_1_1TargetView; + + public static View subNestedReferenceContainer1_2_1TargetView; + + public static View subNestedReferenceContainer1_1_2TargetView; + + public static View subNestedValueContainer1_1_1SourceView; + + public static View subNestedValueContainer1_1_1TargetView, subNestedValueContainer1_2_1TargetView, subNestedValueContainer1_1_2TargetView; + + public static View subNestedActorPartContainer1_2_1TargetView; + + public static View subNestedActorPartContainer1_1_2TargetView; + + public static View nestedPartContainer1_1; + + public static View nestedPartContainer2_1; + + public static View nestedPartContainer1_2; + + @BeforeClass + public static void prepareInheritedNodes() throws Exception { + View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View containerCpt = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + + // Prepare elements for link creation tests + commentSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView()); + commentTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView()); + commentCNSourceView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt); + commentCNTargetView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), containerCpt); + + constraintSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView()); + constraintTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView()); + constraintCNSourceView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt); + constraintCNTargetView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), containerCpt); + } + + @BeforeClass + public static void prepareCustomNodes() throws Exception { + View container = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View blockStructureView = ViewUtil.getChildBySemanticHint(container, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + // part in block (level = 1) + partContainer1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View partContainer1StructureView = ViewUtil.getChildBySemanticHint(partContainer1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + partContainer2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View partContainer2StructureView = ViewUtil.getChildBySemanticHint(partContainer2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + + nestedPartContainer1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + View nestedPartContainer1_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + nestedPartContainer2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + View nestedPartContainer2_1StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer2_1, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + nestedPartContainer1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer2StructureView); + View nestedPartContainer1_2StructureView = ViewUtil.getChildBySemanticHint(nestedPartContainer1_2, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // nested container in nested part (level = 3) + View subNestedPartContainer1_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView); + View subNestedPartContainer2_1_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1StructureView); + + // nested container in nestedPartContainer2_1 (level = 3) + View subNestedPartContainer1_2_1 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1StructureView); + + // nested container in nestedPartContainer1_2StructureView (level = 3) + View subNestedPartContainer1_1_2 = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2StructureView); + + + // Prepare elements for link creation tests + + blockSourceView = container; + blockTargetView = container; + + // Prepare child nodes + + partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPartSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedPartTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + // Port & FlowPorts no distinction made on FlowPorts kind... + portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container); + portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, container); + portOnPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer1); + portOnPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, partContainer2); + portOnNestedPartSourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer1_1); + portOnNestedPartTargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, nestedPartContainer2_1); + portOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView); + portOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1); + portOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1); + portOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2); + + flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container); + flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, container); + flowportOnPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer1); + flowportOnPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)partContainer2.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, partContainer2); + flowportOnNestedPartSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer1_1); + flowportOnNestedPartTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, nestedPartContainer2_1); + flowportOnSubNestedPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_1SourceView); + flowportOnSubNestedPartContainer2_1_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer2_1_1); + flowportOnSubNestedPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer1_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_2_1); + flowportOnSubNestedPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)nestedPartContainer2_1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, subNestedPartContainer1_1_2); + + propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedPropertyContainer1_1_1SourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPropertyContainer1_1_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedPropertyContainer1_2_1TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedPropertyContainer1_1_2TargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedReferenceContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedReferenceContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedReferenceContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedReferenceContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + + valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedValueContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedValueContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedValueContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedValueContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + + actorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedActorPartSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + nestedActorPartTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, partContainer1StructureView); + subNestedActorPartContainer1_1_1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedActorPartContainer1_1_1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_1); + subNestedActorPartContainer1_2_1TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer2_1); + subNestedActorPartContainer1_1_2TargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, nestedPartContainer1_2); + } +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java index fa782347d36..c2a10146539 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java @@ -1,184 +1,184 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorFromPalette;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkPrepareTest;
-import org.eclipse.uml2.uml.Property;
-import org.junit.Test;
-
-/**
- * JUnit abstract tests for Link creation test (via palette tools).
- */
-public class AbstractLinkCreationFromElementTest extends AbstractLinkPrepareTest {
-
- public static String toolID;
-
- public static View sourceView;
-
- public static Map<View, List<Property>> expectedSourceNestedPath;
-
- public static Map<View, List<Property>> expectedTargetNestedPath;
-
- @Test
- public void createLinkWithTargetBlock() throws Exception {
- View targetView = blockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetActorPart() throws Exception {
- View targetView = actorPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedActorPart() throws Exception {
- View targetView = nestedActorPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnBlock() throws Exception {
- View targetView = portOnBlockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnPart() throws Exception {
- View targetView = portOnPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPortOnNestedPart() throws Exception {
- View targetView = portOnNestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnBlock() throws Exception {
- View targetView = flowportOnBlockTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnPart() throws Exception {
- View targetView = flowportOnPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetFlowPortOnNestedPart() throws Exception {
- View targetView = flowportOnNestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetPart() throws Exception {
- View targetView = partTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedPart() throws Exception {
- View targetView = nestedPartTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetProperty() throws Exception {
- View targetView = propertyTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedProperty() throws Exception {
- View targetView = nestedPropertyTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetReference() throws Exception {
- View targetView = referenceTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedReference() throws Exception {
- View targetView = nestedReferenceTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetValue() throws Exception {
- View targetView = valueTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetNestedValue() throws Exception {
- View targetView = nestedValueTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetComment() throws Exception {
- View targetView = commentTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetCommentCN() throws Exception {
- View targetView = commentCNTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetConstraint() throws Exception {
- View targetView = constraintTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetConstraintCN() throws Exception {
- View targetView = constraintCNTargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- // deep nested tests
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_1_1() throws Exception {
- View targetView = subNestedPartContainer1_1_1TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_2_1() throws Exception {
- View targetView = subNestedPartContainer1_2_1TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
- @Test
- public void createLinkWithTargetSubNestedPartContainer_1_1_2() throws Exception {
- View targetView = subNestedPartContainer1_1_2TargetView;
- createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorFromPalette; + +import java.util.List; +import java.util.Map; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkPrepareTest; +import org.eclipse.uml2.uml.Property; +import org.junit.Test; + +/** + * JUnit abstract tests for Link creation test (via palette tools). + */ +public abstract class AbstractLinkCreationFromElementTest extends AbstractLinkPrepareTest { + + public static String toolID; + + public static View sourceView; + + public static Map<View, List<Property>> expectedSourceNestedPath; + + public static Map<View, List<Property>> expectedTargetNestedPath; + + @Test + public void createLinkWithTargetBlock() throws Exception { + View targetView = blockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetActorPart() throws Exception { + View targetView = actorPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedActorPart() throws Exception { + View targetView = nestedActorPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnBlock() throws Exception { + View targetView = portOnBlockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnPart() throws Exception { + View targetView = portOnPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPortOnNestedPart() throws Exception { + View targetView = portOnNestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnBlock() throws Exception { + View targetView = flowportOnBlockTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnPart() throws Exception { + View targetView = flowportOnPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetFlowPortOnNestedPart() throws Exception { + View targetView = flowportOnNestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetPart() throws Exception { + View targetView = partTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedPart() throws Exception { + View targetView = nestedPartTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetProperty() throws Exception { + View targetView = propertyTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedProperty() throws Exception { + View targetView = nestedPropertyTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetReference() throws Exception { + View targetView = referenceTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedReference() throws Exception { + View targetView = nestedReferenceTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetValue() throws Exception { + View targetView = valueTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetNestedValue() throws Exception { + View targetView = nestedValueTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetComment() throws Exception { + View targetView = commentTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetCommentCN() throws Exception { + View targetView = commentCNTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetConstraint() throws Exception { + View targetView = constraintTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetConstraintCN() throws Exception { + View targetView = constraintCNTargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + // deep nested tests + @Test + public void createLinkWithTargetSubNestedPartContainer_1_1_1() throws Exception { + View targetView = subNestedPartContainer1_1_1TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetSubNestedPartContainer_1_2_1() throws Exception { + View targetView = subNestedPartContainer1_2_1TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + + @Test + public void createLinkWithTargetSubNestedPartContainer_1_1_2() throws Exception { + View targetView = subNestedPartContainer1_1_2TargetView; + createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView)); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java index 31580e444d0..121035955ad 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java @@ -1,108 +1,108 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- Property part1 = (Property)partContainer1.getElement();
- Property part2 = (Property)partContainer2.getElement();
- Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement();
- Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement();
- Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement();
- List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property });
- List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property });
- List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property });
- List<Property> nestedPath = Arrays.asList(new Property[]{ part1 });
- List<Property> emptyPath = Collections.emptyList();
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath);
- expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2);
- expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedValueTargetView, nestedPath);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + Property part1 = (Property)partContainer1.getElement(); + Property part2 = (Property)partContainer2.getElement(); + Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement(); + Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement(); + Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement(); + List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property }); + List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property }); + List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property }); + List<Property> nestedPath = Arrays.asList(new Property[]{ part1 }); + List<Property> emptyPath = Collections.emptyList(); + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath); + expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(nestedPartTargetView, nestedPath); + expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1); + expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1); + expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2); + expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath); + expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath); + expectedTargetNestedPath.put(nestedValueTargetView, nestedPath); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java index c69fa68fa83..8fd7b272028 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java @@ -1,111 +1,111 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- Property part1 = (Property)partContainer1.getElement();
- Property part2 = (Property)partContainer2.getElement();
- Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement();
- Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement();
- Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement();
- List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property });
- List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property });
- List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property });
- List<Property> nestedPath = Arrays.asList(new Property[]{ part1 });
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
-
- expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath);
- expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1);
- expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2);
- expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath);
- expectedTargetNestedPath.put(nestedValueTargetView, nestedPath);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, true); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + Property part1 = (Property)partContainer1.getElement(); + Property part2 = (Property)partContainer2.getElement(); + Property nestedPartContainer1_1Property = (Property)nestedPartContainer1_1.getElement(); + Property nestedPartContainer1_2Property = (Property)nestedPartContainer1_2.getElement(); + Property nestedPartContainer2_1Property = (Property)nestedPartContainer2_1.getElement(); + List<Property> subNestedPath1_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer1_1Property }); + List<Property> subNestedPath1_2 = Arrays.asList(new Property[]{ part2, nestedPartContainer1_2Property }); + List<Property> subNestedPath2_1 = Arrays.asList(new Property[]{ part1, nestedPartContainer2_1Property }); + List<Property> nestedPath = Arrays.asList(new Property[]{ part1 }); + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + + expectedTargetNestedPath.put(nestedActorPartTargetView, nestedPath); + expectedTargetNestedPath.put(portOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(flowportOnNestedPartTargetView, subNestedPath2_1); + expectedTargetNestedPath.put(nestedPartTargetView, nestedPath); + expectedTargetNestedPath.put(subNestedPartContainer1_1_1TargetView, subNestedPath1_1); + expectedTargetNestedPath.put(subNestedPartContainer1_2_1TargetView, subNestedPath2_1); + expectedTargetNestedPath.put(subNestedPartContainer1_1_2TargetView, subNestedPath1_2); + expectedTargetNestedPath.put(nestedPropertyTargetView, nestedPath); + expectedTargetNestedPath.put(nestedReferenceTargetView, nestedPath); + expectedTargetNestedPath.put(nestedValueTargetView, nestedPath); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java index 581d4b8a395..bc3df808ce7 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java @@ -1,139 +1,155 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorAndTestDelegateFromPalette;
-
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.junit.Test;
-
-/**
- * JUnit abstract tests for Link creation test (via palette tools).
- */
-public class AbstractConnectorCreationAndTestDelegateFromElementTest extends AbstractConnectorCreationAndTestDelegatePrepareTest {
-
- public static String toolID;
-
- public static View sourceView;
-
- public static Map<View, ConnectableElement> expectedSourcePartWithPort;
-
- public static Map<View, ConnectableElement> expectedTargetPartWithPort;
-
- @Test
- public void createLinkWithSourceBlock() throws Exception {
- View targetView = blockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceActorPart() throws Exception {
- View targetView = actorPart2_BlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedActorPart() throws Exception {
- View targetView = actorPart2_p1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnBlock() throws Exception {
- View targetView = portOnBlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnPart() throws Exception {
- View targetView = port1_Part2TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePortOnNestedPart() throws Exception {
- View targetView = port2OnNestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnBlock() throws Exception {
- View targetView = flowportOnBlockTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnPart() throws Exception {
- View targetView = flowport1_Part2TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceFlowPortOnNestedPart() throws Exception {
- View targetView = flowport1_NestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourcePart() throws Exception {
- View targetView = partTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedPart() throws Exception {
- View targetView = nestedPart2_Part1TargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceProperty() throws Exception {
- View targetView = propertyTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedProperty() throws Exception {
- View targetView = nestedPropertyTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceReference() throws Exception {
- View targetView = referenceTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedReference() throws Exception {
- View targetView = nestedReferenceTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceValue() throws Exception {
- View targetView = valueTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
- @Test
- public void createLinkWithSourceNestedValue() throws Exception {
- View targetView = nestedValueTargetView;
- createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView));
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestUtils.createEdgeConnectorAndTestDelegateFromPalette; + +import java.util.Map; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.junit.Test; + +/** + * JUnit abstract tests for Link creation test (via palette tools). + */ +public abstract class AbstractConnectorCreationAndTestDelegateFromElementTest extends AbstractConnectorCreationAndTestDelegatePrepareTest { + + public static String toolID; + + public static View sourceView; + + public static Map<View, ConnectableElement> expectedSourcePartWithPort; + + public static Map<View, ConnectableElement> expectedTargetPartWithPort; + + // FIXME : wrong name in all methods => replace Source by Target + // BMA : ne passe pas là + @Test + public void createLinkWithSourceBlock() throws Exception { + View targetView = blockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceActorPart() throws Exception { + View targetView = actorPart2_BlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedActorPart() throws Exception { + View targetView = actorPart2_p1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnBlock() throws Exception { + View targetView = portOnBlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + // BMA : ne passe pas là + @Test + public void createLinkWithTargetPort2OnPart1() throws Exception { + View targetView = port2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + // BMA : ne passe pas là + @Test + public void createLinkWithTargetPort1OnPart1() throws Exception { + View targetView = port1_Part1SourceView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnPart() throws Exception { + View targetView = port1_Part2TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePortOnNestedPart() throws Exception { + View targetView = port2OnNestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnBlock() throws Exception { + View targetView = flowportOnBlockTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnPart() throws Exception { + View targetView = flowport1_Part2TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceFlowPortOnNestedPart() throws Exception { + View targetView = flowport1_NestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourcePart() throws Exception { + View targetView = partTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedPart() throws Exception { + View targetView = nestedPart2_Part1TargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceProperty() throws Exception { + View targetView = propertyTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedProperty() throws Exception { + View targetView = nestedPropertyTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceReference() throws Exception { + View targetView = referenceTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedReference() throws Exception { + View targetView = nestedReferenceTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceValue() throws Exception { + View targetView = valueTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + + @Test + public void createLinkWithSourceNestedValue() throws Exception { + View targetView = nestedValueTargetView; + createEdgeConnectorAndTestDelegateFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourcePartWithPort.get(targetView), expectedTargetPartWithPort.get(targetView)); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java index 1d6474568f0..bb7a2a132bd 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java @@ -1,143 +1,150 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView;
-import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for link creation test (via palette tools).
- */
-public class AbstractConnectorCreationAndTestDelegatePrepareTest extends AbstractTest {
-
- public static String toolID;
-
- // Custom nodes
- public static View blockSourceView, blockTargetView;
-
- // Custom child label nodes
- public static View actorPart1_BlockSourceView, actorPart2_BlockTargetView;
- public static View actorPart1_p1_SourceView, actorPart2_p1TargetView, actorPart1_p2TargetView, actorPart1_p1_p1SourceView, actorPart2_p1_p1TargetView, actorPart1_p2_p1TargetView, actorPart1_p1_p2TargetView;
- public static View portOnBlockSourceView, portOnBlockTargetView;
- public static View port1_Part1SourceView, port1_Part2TargetView;
- public static View port1OnNestedPart1_Part1SourceView, port2OnNestedPart2_Part1TargetView, port1OnNestedPart1_Part2TargetView;
- public static View flowportOnBlockSourceView, flowportOnBlockTargetView;
- public static View flowport1_Part1SourceView, flowport1_Part2TargetView;
- public static View flowport1_NestedPart1_Part1SourceView, flowport1_NestedPart2_Part1TargetView, flowport1_NestedPart1_Part2TargetView;
- public static View partSourceView, partTargetView;
- public static View nestedPart1_Part1SourceView, nestedPart2_Part1TargetView, nestedPart1_Part2TargetView;
- public static View propertySourceView, propertyTargetView;
- public static View nestedPropertySourceView, nestedPropertyTargetView;
- public static View referenceSourceView, referenceTargetView;
- public static View nestedReferenceSourceView, nestedReferenceTargetView;
- public static View valueSourceView, valueTargetView;
- public static View nestedValueSourceView, nestedValueTargetView;
-
- public static View p1View; // Its type block may be set encapsulated for testing purpose.
- public static View p2View; // Its type block may be set encapsulated for testing purpose.
- public static View p1_p1View, p2_p1View;
- public static View p1_p1StructureView, p2_p1StructureView;
- public static View p1_p2View;
- public static View p1_p2StructureView;
-
-
- public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
-
- @BeforeClass
- public static void prepareCustomNodes() throws Exception {
- View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
- View blockStructureView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
- p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- View p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // nested part to contain elements to be tested on level 2
- p1_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- p1_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p2_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- p2_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- p1_p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
- p1_p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
-
- // Prepare elements for link creation tests
-
- blockSourceView = blockView;
- blockTargetView = blockView;
-
- // Prepare child nodes
- actorPart1_BlockSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPart2_BlockTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- actorPart1_p1_SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- actorPart2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- actorPart1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
- actorPart1_p1_p1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView);
- actorPart2_p1_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView);
- actorPart1_p2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2_p1StructureView);
- actorPart1_p1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p2StructureView);
-
-
- // Port & FlowPorts no distinction made on FlowPorts kind...
- portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView);
- portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView);
- port1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View);
- port1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View);
- port1OnNestedPart1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p1View);
- port2OnNestedPart2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2_p1View);
- port1OnNestedPart1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p2View);
-
- flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView);
- flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView);
- flowport1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1View);
- flowport1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2View);
- flowport1_NestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p1View);
- flowport1_NestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2_p1View);
- flowport1_NestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p2View);
-
- partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView);
-
- propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
-
- referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
-
- valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView);
- nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView);
- }
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.EditorUtils.getDiagramView; +import static org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils.TestPrepareUtils.createGraphicalNode; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; +import org.eclipse.papyrus.sysml.diagram.internalblock.tests.AbstractTest; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; +import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.BeforeClass; + +/** + * JUnit tests for link creation test (via palette tools). + */ +public abstract class AbstractConnectorCreationAndTestDelegatePrepareTest extends AbstractTest { + + public static String toolID; + + // Custom nodes + public static View blockSourceView, blockTargetView; + + // Custom child label nodes + public static View actorPart1_BlockSourceView, actorPart2_BlockTargetView; + public static View actorPart1_p1_SourceView, actorPart2_p1TargetView, actorPart1_p2TargetView, actorPart1_p1_p1SourceView, actorPart2_p1_p1TargetView, actorPart1_p2_p1TargetView, actorPart1_p1_p2TargetView; + public static View portOnBlockSourceView, portOnBlockTargetView; + public static View port1_Part1SourceView, port2_Part1TargetView, port1_Part2TargetView, port2_Part2TargetView; + public static View port1OnNestedPart1_Part1SourceView, port2OnNestedPart2_Part1TargetView, port1OnNestedPart1_Part2TargetView; + public static View flowportOnBlockSourceView, flowportOnBlockTargetView; + public static View flowport1_Part1SourceView, flowport1_Part2TargetView; + public static View flowport1_NestedPart1_Part1SourceView, flowport1_NestedPart2_Part1TargetView, flowport1_NestedPart1_Part2TargetView; + public static View partSourceView, partTargetView; + public static View nestedPart1_Part1SourceView, nestedPart2_Part1TargetView, nestedPart1_Part2TargetView; + public static View propertySourceView, propertyTargetView; + public static View nestedPropertySourceView, nestedPropertyTargetView; + public static View referenceSourceView, referenceTargetView; + public static View nestedReferenceSourceView, nestedReferenceTargetView; + public static View valueSourceView, valueTargetView; + public static View nestedValueSourceView, nestedValueTargetView; + + public static View p1View; // Its type block may be set encapsulated for testing purpose. + public static View p2View; // Its type block may be set encapsulated for testing purpose. + public static View p1_p1View, p2_p1View; + public static View p1_p1StructureView, p2_p1StructureView; + public static View p1_p2View; + public static View p1_p2StructureView; + + + public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>(); + + @BeforeClass + public static void prepareCustomNodes() throws Exception { + View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); + View blockStructureView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); + p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + View p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // nested part to contain elements to be tested on level 2 + p1_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + p1_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p2_p1View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + p2_p1StructureView = ViewUtil.getChildBySemanticHint(p1View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + p1_p2View = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + p1_p2StructureView = ViewUtil.getChildBySemanticHint(p2View, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); + + // Prepare elements for link creation tests + + blockSourceView = blockView; + blockTargetView = blockView; + + // Prepare child nodes + actorPart1_BlockSourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPart2_BlockTargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + actorPart1_p1_SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + actorPart2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + actorPart1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + actorPart1_p1_p1SourceView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView); + actorPart2_p1_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p1StructureView); + actorPart1_p2_p1TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2_p1StructureView); + actorPart1_p1_p2TargetView = createGraphicalNode(SysMLElementTypes.ACTOR_PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1_p2StructureView); + + + // Port & FlowPorts no distinction made on FlowPorts kind... + portOnBlockSourceView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView); + portOnBlockTargetView = createGraphicalNode(UMLElementTypes.PORT, UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, blockView); + port1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View); + port2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1View); + port1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View); + + // BMA temp + port2_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2View); + + // ?? kesako ? + port1OnNestedPart1_Part1SourceView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p1View); + port2OnNestedPart2_Part1TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p2_p1View); + port1OnNestedPart1_Part2TargetView = createGraphicalNode(UMLElementTypes.PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, p1_p2View); + + flowportOnBlockSourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView); + flowportOnBlockTargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, blockView); + flowport1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1View); + flowport1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2View); + flowport1_NestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p1View); + flowport1_NestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p2_p1View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p2_p1View); + flowport1_NestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.FLOW_PORT, (EObject)p1_p2View.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type()), SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, p1_p2View); + + partSourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + partTargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPart1_Part1SourceView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPart2_Part1TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPart1_Part2TargetView = createGraphicalNode(SysMLElementTypes.PART_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p2StructureView); + + propertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + propertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedPropertySourceView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedPropertyTargetView = createGraphicalNode(UMLElementTypes.PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + referenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + referenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedReferenceSourceView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedReferenceTargetView = createGraphicalNode(SysMLElementTypes.REFERENCE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + valueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + valueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, blockStructureView); + nestedValueSourceView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + nestedValueTargetView = createGraphicalNode(SysMLElementTypes.VALUE_PROPERTY, SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, p1StructureView); + + } +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java index ee28e38faf8..68d13cdfb21 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = actorPart1_BlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = actorPart1_BlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java index 522436ddf34..1e25e37a136 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java index b476916d57a..6c0443359d7 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java @@ -1,89 +1,91 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowport1_NestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property sourceNestedpart = (Property)p1_p1View.getElement();
-
- Property targetpart = (Property)p2View.getElement();
- Property targetNestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, sourceNestedpart);
- }
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowport1_NestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property sourceNestedpart = (Property)p1_p1View.getElement(); + + Property targetpart = (Property)p2View.getElement(); + Property targetNestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, sourceNestedpart); + } + + expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java index fb793d13f81..f2a0e00fb8c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java @@ -1,96 +1,99 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromFlowPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowport1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part1 = (Property)p1View.getElement();
- Property part2 = (Property)p2View.getElement();
- Property nestedPart2 = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, part1);
- }
-
- expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(actorPart2_p1TargetView);
- expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(nestedPropertyTargetView);
- expectedSourcePartWithPort.remove(nestedReferenceTargetView);
- expectedSourcePartWithPort.remove(nestedValueTargetView);
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part2);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromFlowPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowport1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedPart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, part1); + } + expectedSourcePartWithPort.remove(port1_Part1SourceView); + expectedSourcePartWithPort.remove(port2_Part1TargetView); + expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(actorPart2_p1TargetView); + expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(nestedPropertyTargetView); + expectedSourcePartWithPort.remove(nestedReferenceTargetView); + expectedSourcePartWithPort.remove(nestedValueTargetView); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java index b554f662190..0cb2a661f37 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = actorPart1_p1_SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedActorPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = actorPart1_p1_SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java index c59c5294130..9d65104a659 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java index 65d36961241..96792ca698b 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedPropertySourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedPropertySourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java index 208eb5be469..12f49ae4035 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedReference extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedReferenceSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedReference extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedReferenceSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java index 6277e861e1c..464b3d13ca1 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java @@ -1,82 +1,84 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromNestedValue extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = nestedValueSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromNestedValue extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = nestedValueSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java index 6030bcc815e..aedf2fe7273 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = partSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = partSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java index 86ebc85e890..1a4fc9bb12c 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnBlock extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java index d4fe4835eb5..119aee81813 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java @@ -1,89 +1,91 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = port1OnNestedPart1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property sourceNestedpart = (Property)p1_p1View.getElement();
-
- Property targetpart = (Property)p2View.getElement();
- Property targetNestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, sourceNestedpart);
- }
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnNestedPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = port1OnNestedPart1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property sourceNestedpart = (Property)p1_p1View.getElement(); + + Property targetpart = (Property)p2View.getElement(); + Property targetNestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, sourceNestedpart); + } + + expectedTargetPartWithPort.put(port1_Part2TargetView, targetpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, targetpart); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, targetNestedpart); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, targetNestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java index 9f12d238a42..c08a697c828 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java @@ -1,96 +1,100 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = port1_Part1SourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part1 = (Property)p1View.getElement();
- Property part2 = (Property)p2View.getElement();
- Property nestedPart2 = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- for (View view : isCreationAllowed.keySet()) {
- expectedSourcePartWithPort.put(view, part1);
- }
-
- expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(actorPart2_p1TargetView);
- expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView);
- expectedSourcePartWithPort.remove(nestedPropertyTargetView);
- expectedSourcePartWithPort.remove(nestedReferenceTargetView);
- expectedSourcePartWithPort.remove(nestedValueTargetView);
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part2);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2);
-
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromPortOnPart extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = port1_Part1SourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedPart2 = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + for (View view : isCreationAllowed.keySet()) { + expectedSourcePartWithPort.put(view, part1); + } + + expectedSourcePartWithPort.remove(port1_Part1SourceView); + expectedSourcePartWithPort.remove(port2_Part1TargetView); + expectedSourcePartWithPort.remove(port2OnNestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(flowport1_NestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(actorPart2_p1TargetView); + expectedSourcePartWithPort.remove(nestedPart2_Part1TargetView); + expectedSourcePartWithPort.remove(nestedPropertyTargetView); + expectedSourcePartWithPort.remove(nestedReferenceTargetView); + expectedSourcePartWithPort.remove(nestedValueTargetView); + + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedPart2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedPart2); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java index e0a2db10113..5bea2abc30a 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = propertySourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromProperty extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = propertySourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java index 2440b9dbd22..57d4f1b65ed 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromReference extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = referenceSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromReference extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = referenceSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java index 6c8834811e4..a9fd1985284 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java @@ -1,82 +1,87 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation;
-
-import java.util.HashMap;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestCreationAndTestDelegateFromValue extends AbstractConnectorCreationAndTestDelegateFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = valueSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPart2_BlockTargetView, true);
- isCreationAllowed.put(actorPart2_p1TargetView, true);
-
- isCreationAllowed.put(portOnBlockTargetView, true);
- isCreationAllowed.put(port1_Part2TargetView, true);
- isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(flowportOnBlockTargetView, true);
- isCreationAllowed.put(flowport1_Part2TargetView, true);
- isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPart2_Part1TargetView, true);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, true);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, true);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, true);
-
- // Initialize partWithPort for tests
- Property part = (Property)p2View.getElement();
- Property nestedpart = (Property)p2_p1View.getElement();
-
- expectedSourcePartWithPort = new HashMap<View, ConnectableElement>();
- expectedTargetPartWithPort = new HashMap<View, ConnectableElement>();
-
- expectedTargetPartWithPort.put(port1_Part2TargetView, part);
- expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart);
- expectedTargetPartWithPort.put(flowport1_Part2TargetView, part);
- expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.delegation; + +import java.util.HashMap; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestCreationAndTestDelegateFromValue extends AbstractConnectorCreationAndTestDelegateFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = valueSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPart2_BlockTargetView, true); + isCreationAllowed.put(actorPart2_p1TargetView, true); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(port1_Part1SourceView, true); + isCreationAllowed.put(port2_Part1TargetView, true); + isCreationAllowed.put(port1_Part2TargetView, true); + isCreationAllowed.put(port2OnNestedPart2_Part1TargetView, true); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowport1_Part2TargetView, true); + isCreationAllowed.put(flowport1_NestedPart2_Part1TargetView, true); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPart2_Part1TargetView, true); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, true); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, true); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, true); + + // Initialize partWithPort for tests + Property part1 = (Property)p1View.getElement(); + Property part2 = (Property)p2View.getElement(); + Property nestedpart = (Property)p2_p1View.getElement(); + + expectedSourcePartWithPort = new HashMap<View, ConnectableElement>(); + expectedTargetPartWithPort = new HashMap<View, ConnectableElement>(); + + expectedTargetPartWithPort.put(port1_Part1SourceView, part1); + expectedTargetPartWithPort.put(port2_Part1TargetView, part1); + expectedTargetPartWithPort.put(port1_Part2TargetView, part2); + expectedTargetPartWithPort.put(port2OnNestedPart2_Part1TargetView, nestedpart); + expectedTargetPartWithPort.put(flowport1_Part2TargetView, part2); + expectedTargetPartWithPort.put(flowport1_NestedPart2_Part1TargetView, nestedpart); + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java index 5d2d4d0c2f7..44f7350e9e1 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java @@ -1,90 +1,90 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = flowportOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, false);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, false);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, false);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, false);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, false);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, false);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromFlowPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = flowportOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, false); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, false); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, false); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, false); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, false); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, false); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + } + +} diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java index db6c6dc4b1f..1dc9c1b031f 100644 --- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java +++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java @@ -1,90 +1,90 @@ -/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-import org.junit.BeforeClass;
-
-/**
- * JUnit tests for Connector link creation test (via palette tools).
- */
-public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest {
-
- @BeforeClass
- public static void initSource() throws Exception {
- sourceView = portOnBlockSourceView;
- }
-
- @BeforeClass
- public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
- @BeforeClass
- public static void initExpectedResults() throws Exception {
-
- // Initialize source creation results
- isCreationAllowed = new HashMap<View, Boolean>();
-
- isCreationAllowed.put(blockTargetView, false);
-
- isCreationAllowed.put(actorPartTargetView, true);
- isCreationAllowed.put(nestedActorPartTargetView, false);
-
- isCreationAllowed.put(portOnBlockTargetView, false);
- isCreationAllowed.put(portOnPartTargetView, true);
- isCreationAllowed.put(portOnNestedPartTargetView, false);
-
- isCreationAllowed.put(flowportOnBlockTargetView, false);
- isCreationAllowed.put(flowportOnPartTargetView, true);
- isCreationAllowed.put(flowportOnNestedPartTargetView, false);
-
- isCreationAllowed.put(partTargetView, true);
- isCreationAllowed.put(nestedPartTargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false);
- isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false);
-
- isCreationAllowed.put(propertyTargetView, true);
- isCreationAllowed.put(nestedPropertyTargetView, false);
-
- isCreationAllowed.put(referenceTargetView, true);
- isCreationAllowed.put(nestedReferenceTargetView, false);
-
- isCreationAllowed.put(valueTargetView, true);
- isCreationAllowed.put(nestedValueTargetView, false);
-
- isCreationAllowed.put(commentTargetView, false);
- isCreationAllowed.put(commentCNTargetView, false);
- isCreationAllowed.put(constraintTargetView, false);
- isCreationAllowed.put(constraintCNTargetView, false);
-
- // Initialize nested property path for tests
- List<Property> emptyPath = Collections.emptyList();
-
- expectedSourceNestedPath = new HashMap<View, List<Property>>();
- expectedTargetNestedPath = new HashMap<View, List<Property>>();
-
- for(View view : isCreationAllowed.keySet()) {
- expectedSourceNestedPath.put(view, emptyPath);
- expectedTargetNestedPath.put(view, emptyPath);
- }
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.uml2.uml.Property; +import org.junit.BeforeClass; + +/** + * JUnit tests for Connector link creation test (via palette tools). + */ +public class TestLinkCreationConnectorFromPortOnBlock extends AbstractLinkCreationFromElementTest { + + @BeforeClass + public static void initSource() throws Exception { + sourceView = portOnBlockSourceView; + } + + @BeforeClass + public static void initToolID() throws Exception { + toolID = "internalblock.tool.connector"; + } + + @BeforeClass + public static void initExpectedResults() throws Exception { + + // Initialize source creation results + isCreationAllowed = new HashMap<View, Boolean>(); + + isCreationAllowed.put(blockTargetView, false); + + isCreationAllowed.put(actorPartTargetView, true); + isCreationAllowed.put(nestedActorPartTargetView, false); + + isCreationAllowed.put(portOnBlockTargetView, true); + isCreationAllowed.put(portOnPartTargetView, true); + isCreationAllowed.put(portOnNestedPartTargetView, false); + + isCreationAllowed.put(flowportOnBlockTargetView, true); + isCreationAllowed.put(flowportOnPartTargetView, true); + isCreationAllowed.put(flowportOnNestedPartTargetView, false); + + isCreationAllowed.put(partTargetView, true); + isCreationAllowed.put(nestedPartTargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_2_1TargetView, false); + isCreationAllowed.put(subNestedPartContainer1_1_2TargetView, false); + + isCreationAllowed.put(propertyTargetView, true); + isCreationAllowed.put(nestedPropertyTargetView, false); + + isCreationAllowed.put(referenceTargetView, true); + isCreationAllowed.put(nestedReferenceTargetView, false); + + isCreationAllowed.put(valueTargetView, true); + isCreationAllowed.put(nestedValueTargetView, false); + + isCreationAllowed.put(commentTargetView, false); + isCreationAllowed.put(commentCNTargetView, false); + isCreationAllowed.put(constraintTargetView, false); + isCreationAllowed.put(constraintCNTargetView, false); + + // Initialize nested property path for tests + List<Property> emptyPath = Collections.emptyList(); + + expectedSourceNestedPath = new HashMap<View, List<Property>>(); + expectedTargetNestedPath = new HashMap<View, List<Property>>(); + + for(View view : isCreationAllowed.keySet()) { + expectedSourceNestedPath.put(view, emptyPath); + expectedTargetNestedPath.put(view, emptyPath); + } + } + +} |