aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-01-30 08:10:48 (EST)
committervlorenzo2014-01-31 07:35:18 (EST)
commit1eaaf3cec9afacfc9413be01455bf0cedc98efb1 (patch)
tree84b5f508c74a5f671924903b2cd8e36a2103afcc
parent5ed67de8ae01238b3bc16474b5a3727d606a19b6 (diff)
downloadorg.eclipse.papyrus-1eaaf3cec9afacfc9413be01455bf0cedc98efb1.zip
org.eclipse.papyrus-1eaaf3cec9afacfc9413be01455bf0cedc98efb1.tar.gz
org.eclipse.papyrus-1eaaf3cec9afacfc9413be01455bf0cedc98efb1.tar.xz
Bug 418586 - [Connector] [UML] [SysML] [CompositeStructureDiagram]
Problems with UML/SysML Connector Allow connector : - on the same port - between ports of the same part - between ports of the same Block Change-Id: If0e0391d10e8a15ff15471a30d87f60927bebf35 Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/BlockConnectorEditHelperAdvice.java212
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java41
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java560
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java55
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/AbstractLinkPrepareTest.java522
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java368
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromFlowPortOnBlock.java216
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/TestLinkCreationConnectorFromPortOnBlock.java222
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegateFromElementTest.java294
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/AbstractConnectorCreationAndTestDelegatePrepareTest.java293
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromActorPart.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnBlock.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnNestedPart.java180
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromFlowPortOnPart.java195
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedActorPart.java166
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedPart.java166
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedProperty.java166
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedReference.java166
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromNestedValue.java166
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPart.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnBlock.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnNestedPart.java180
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromPortOnPart.java196
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromProperty.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromReference.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/delegation/TestCreationAndTestDelegateFromValue.java169
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromFlowPortOnBlock.java180
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/encapsulated/TestLinkCreationConnectorFromPortOnBlock.java180
28 files changed, 3030 insertions, 2877 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/BlockConnectorEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/BlockConnectorEditHelperAdvice.java
index 23ea34d..90237b7 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/BlockConnectorEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/BlockConnectorEditHelperAdvice.java
@@ -1,103 +1,109 @@
-/*****************************************************************************
- * 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.service.types.helper.advice;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.blocks.Block;
-import org.eclipse.papyrus.sysml.service.types.command.SetNestedPathCommand;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * <pre>
- * This HelperAdvice completes {@link Block} edit commands with SysML
- * specific {@link Connector} related actions:
- * - Block::isEncapsulated management
- * - NestedPropertyEnd management
- * </pre>
- */
-public class BlockConnectorEditHelperAdvice extends AbstractEditHelperAdvice {
-
- private ConnectorUtils utils = new ConnectorUtils();
-
- @Override
- protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) {
-
- View sourceView = RequestParameterUtils.getSourceView(request);
- View targetView = RequestParameterUtils.getTargetView(request);
-
- // Restrict this advice action to the end of Connector creation gesture (before clicking on target)
- // in order to add SysML specific constraint
- if((request.getElementType() == UMLElementTypes.CONNECTOR)
- && (request.getSource() != null) && (request.getTarget() != null) && (request.getContainer() != null)) {
-
- // Restrict action to SysML Connector (meaning owned by Block)
- if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(request.getContainer())) {
-
- // If the source or target view is enclosed in a structure encapsulated view, forbid creation.
- if(utils.isCrossingEncapsulation(sourceView, targetView)
- || utils.isCrossingEncapsulation(targetView, sourceView)) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
-
- return super.getBeforeCreateRelationshipCommand(request);
- }
-
- @Override
- protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) {
-
- ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request);
-
- View sourceView = RequestParameterUtils.getSourceView(request);
- View targetView = RequestParameterUtils.getTargetView(request);
-
- // Restrict this advice action to the end of Connector creation gesture (before clicking on target)
- // in order to add SysML specific constraint
- if((request.getElementType() == UMLElementTypes.CONNECTOR)
- && (request.getSource() != null) && (request.getTarget() != null) && (request.getContainer() != null)) {
-
- // Restrict action to SysML Connector (meaning owned by Block)
- if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(request.getContainer())) {
-
- // Check if source view is nested
- if(utils.isNestedConnectableElement(sourceView, targetView)){
- List<Property> nestedPath = utils.getNestedPropertyPath(sourceView, targetView);
- defaultCommand = CompositeCommand.compose(defaultCommand, new SetNestedPathCommand("Set connector nested source path", request.getNewElement(), request, nestedPath, SetNestedPathCommand.NESTED_SOURCE)); //$NON-NLS-0$
- }
-
- // Check if target view is nested
- if(utils.isNestedConnectableElement(targetView, sourceView)){
- List<Property> nestedPath = utils.getNestedPropertyPath(targetView, sourceView);
- defaultCommand = CompositeCommand.compose(defaultCommand, new SetNestedPathCommand("Set connector nested source path", request.getNewElement(), request, nestedPath, SetNestedPathCommand.NESTED_TARGET)); //$NON-NLS-0$
- }
- }
- }
-
- return defaultCommand;
- }
-}
+/*****************************************************************************
+ * 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.service.types.helper.advice;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.service.types.command.SetNestedPathCommand;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * <pre>
+ * This HelperAdvice completes {@link Block} edit commands with SysML
+ * specific {@link Connector} related actions:
+ * - Block::isEncapsulated management
+ * - NestedPropertyEnd management
+ * </pre>
+ */
+public class BlockConnectorEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ private ConnectorUtils utils = new ConnectorUtils();
+
+ @Override
+ protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) {
+
+ EObject source = request.getSource();
+ EObject target = request.getTarget();
+ View sourceView = RequestParameterUtils.getSourceView(request);
+ View targetView = RequestParameterUtils.getTargetView(request);
+
+ // Restrict this advice action to the end of Connector creation gesture (before clicking on target)
+ // in order to add SysML specific constraint
+ if((request.getElementType() == UMLElementTypes.CONNECTOR)
+ && (request.getSource() != null) && (request.getTarget() != null) && (request.getContainer() != null)) {
+
+ // Restrict action to SysML Connector (meaning owned by Block)
+ if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(request.getContainer())) {
+
+ // If the source or target view is enclosed in a structure encapsulated view, forbid creation.
+ if(utils.isCrossingEncapsulation(sourceView, targetView)
+ || utils.isCrossingEncapsulation(targetView, sourceView)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (ConnectorUtils.canCreate(source, target, sourceView, targetView)) {
+ request.setParameter( org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants.UML_STRICT, false);
+ }
+ }
+ }
+
+ return super.getBeforeCreateRelationshipCommand(request);
+ }
+
+ @Override
+ protected ICommand getAfterCreateRelationshipCommand(CreateRelationshipRequest request) {
+
+ ICommand defaultCommand = super.getAfterCreateRelationshipCommand(request);
+
+ View sourceView = RequestParameterUtils.getSourceView(request);
+ View targetView = RequestParameterUtils.getTargetView(request);
+
+ // Restrict this advice action to the end of Connector creation gesture (before clicking on target)
+ // in order to add SysML specific constraint
+ if((request.getElementType() == UMLElementTypes.CONNECTOR)
+ && (request.getSource() != null) && (request.getTarget() != null) && (request.getContainer() != null)) {
+
+ // Restrict action to SysML Connector (meaning owned by Block)
+ if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(request.getContainer())) {
+
+ // Check if source view is nested
+ if(utils.isNestedConnectableElement(sourceView, targetView)){
+ List<Property> nestedPath = utils.getNestedPropertyPath(sourceView, targetView);
+ defaultCommand = CompositeCommand.compose(defaultCommand, new SetNestedPathCommand("Set connector nested source path", request.getNewElement(), request, nestedPath, SetNestedPathCommand.NESTED_SOURCE)); //$NON-NLS-0$
+ }
+
+ // Check if target view is nested
+ if(utils.isNestedConnectableElement(targetView, sourceView)){
+ List<Property> nestedPath = utils.getNestedPropertyPath(targetView, sourceView);
+ defaultCommand = CompositeCommand.compose(defaultCommand, new SetNestedPathCommand("Set connector nested source path", request.getNewElement(), request, nestedPath, SetNestedPathCommand.NESTED_TARGET)); //$NON-NLS-0$
+ }
+ }
+ }
+
+ return defaultCommand;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
index bb965e5..d9d723e 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
@@ -387,4 +387,45 @@ public class ConnectorUtils extends org.eclipse.papyrus.uml.service.types.utils.
return null;
}
+ /**
+ * Test if the relationship creation is allowed.
+ *
+ * @param source
+ * the relationship source can be null
+ * @param target
+ * the relationship target can be null
+ * @param sourceView
+ * the relationship graphical source can be null
+ * @param targetView
+ * the relationship graphical target can be null
+ * @return true if the creation is allowed
+ */
+ public static boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
+
+ if((source != null) && !(source instanceof ConnectableElement)) {
+ return false;
+ }
+
+ if((target != null) && !(target instanceof ConnectableElement)) {
+ return false;
+ }
+
+ if((sourceView != null) && (targetView != null)) {
+ // Allow to create a self connector on a view
+// if(sourceView == targetView) {
+// return false;
+// }
+
+ // Cannot create a connector from a view representing a Part to its own Port (or the opposite)
+ if((sourceView.getChildren().contains(targetView)) || (targetView.getChildren().contains(sourceView))) {
+ return false;
+ }
+
+ // Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
+ if(new ConnectorUtils().getStructureContainers(sourceView).contains(targetView) || new ConnectorUtils().getStructureContainers(targetView).contains(sourceView)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
index 11d1051..3b4e7f9 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
@@ -1,268 +1,292 @@
-/*****************************************************************************
- * Copyright (c) 2011-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.uml.service.types.helper;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.IdentityCommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.service.types.command.ConnectorReorientCommand;
-import org.eclipse.papyrus.uml.service.types.utils.ConnectorUtils;
-import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * Edit helper class for binary {@link Connector}
- */
-public class ConnectorEditHelper extends ElementEditHelper {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return new ConnectorReorientCommand(req);
- }
-
- /**
- * Test if the relationship creation is allowed.
- *
- * @param source
- * the relationship source can be null
- * @param target
- * the relationship target can be null
- * @param sourceView
- * the relationship graphical source can be null
- * @param targetView
- * the relationship graphical target can be null
- * @return true if the creation is allowed
- */
- protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
-
- if((source != null) && !(source instanceof ConnectableElement)) {
- return false;
- }
-
- if((target != null) && !(target instanceof ConnectableElement)) {
- return false;
- }
-
- if((sourceView != null) && (targetView != null)) {
- // Cannot create a self connector on a view
- if(sourceView == targetView) {
- return false;
- }
-
- // Cannot create a connector from a view representing a Part to its own Port (or the opposite)
- if((sourceView.getChildren().contains(targetView)) || (targetView.getChildren().contains(sourceView))) {
- return false;
- }
-
- // Cannot connect two Port owned by the same view
- if((sourceView.getElement() instanceof Port) && (targetView.getElement() instanceof Port)) {
- if(ViewUtil.getContainerView(sourceView) == ViewUtil.getContainerView(targetView)) {
- return false;
- }
- }
-
- // Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
- if(getStructureContainers(sourceView).contains(targetView) || getStructureContainers(targetView).contains(sourceView)) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
- EObject source = req.getSource();
- EObject target = req.getTarget();
-
- boolean noSourceOrTarget = (source == null || target == null);
- boolean noSourceAndTarget = (source == null && target == null);
-
- if(!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
- // Abort creation.
- return UnexecutableCommand.INSTANCE;
- }
-
- if(noSourceOrTarget && !noSourceAndTarget) {
- // The request isn't complete yet. Return the identity command so
- // that the create relationship gesture is enabled.
- return IdentityCommand.INSTANCE;
- }
-
- // Propose a semantic container for the new Connector.
- StructuredClassifier proposedContainer = deduceContainer(req);
- if(proposedContainer == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- req.setContainer(proposedContainer);
-
- return new CreateRelationshipCommand(req);
- }
-
- /**
- * This method provides the source role provided as {@link ConfigureRequest} parameter.
- *
- * @return the target role
- */
- private ConnectableElement getSourceRole(IEditCommandRequest req) {
- ConnectableElement result = null;
- Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
- if(paramObject instanceof ConnectableElement) {
- result = (ConnectableElement)paramObject;
- }
-
- return result;
- }
-
- /**
- * This method provides the target role provided as {@link ConfigureRequest} parameter.
- *
- * @return the target role
- */
- private ConnectableElement getTargetRole(IEditCommandRequest req) {
- ConnectableElement result = null;
- Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
- if(paramObject instanceof ConnectableElement) {
- result = (ConnectableElement)paramObject;
- }
-
- return result;
- }
-
- /**
- * This method provides the source partWithPort provided as {@link ConfigureRequest} parameter.
- *
- * @return the target partWithPort
- */
- private Property getSourcePartWithPort(IEditCommandRequest req) {
- Property result = null;
- if(getSourceRole(req) instanceof Port) {
- // Only look for PartWithPort if the role is a Port.
-
- View parentView = ViewUtil.getContainerView(RequestParameterUtils.getSourceView(req));
- EObject semanticParent = parentView.getElement();
- if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
- // Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getTargetView(req))) {
- result = (Property)semanticParent;
- }
- }
-
- }
- return result;
- }
-
- /**
- * This method provides the target partWithPort provided as {@link ConfigureRequest} parameter.
- *
- * @return the target partWithPort
- */
- private Property getTargetPartWithPort(IEditCommandRequest req) {
- Property result = null;
- if(getTargetRole(req) instanceof Port) {
- // Only look for PartWithPort if the role is a Port.
-
- View parentView = ViewUtil.getContainerView(RequestParameterUtils.getTargetView(req));
- EObject semanticParent = parentView.getElement();
- if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
- // Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getSourceView(req))) {
- result = (Property)semanticParent;
- }
- }
-
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getConfigureCommand(final ConfigureRequest req) {
-
- final Connector connector = (Connector)req.getElementToConfigure();
- final ConnectableElement sourceRole = getSourceRole(req);
- final ConnectableElement targetRole = getTargetRole(req);
- final Property sourcePartWithPort = getSourcePartWithPort(req);
- final Property targetPartWithPort = getTargetPartWithPort(req);
-
- ICommand configureCommand = new ConfigureElementCommand(req) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- if((sourceRole == null) || (targetRole == null)) {
- //to allow creation from the ModelExplorer or from the table
- //return CommandResult.newCancelledCommandResult();
- }
-
- // Add source connector end
- ConnectorEnd sourceEnd = UMLFactory.eINSTANCE.createConnectorEnd();
- sourceEnd.setRole(sourceRole);
- sourceEnd.setPartWithPort(sourcePartWithPort);
-
- // Add target connector end
- ConnectorEnd targetEnd = UMLFactory.eINSTANCE.createConnectorEnd();
- targetEnd.setRole(targetRole);
- targetEnd.setPartWithPort(targetPartWithPort);
-
- connector.getEnds().add(sourceEnd);
- connector.getEnds().add(targetEnd);
-
- return CommandResult.newOKCommandResult(connector);
- }
- };
-
- return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
- }
-
- private StructuredClassifier deduceContainer(CreateRelationshipRequest request) {
- return new ConnectorUtils().deduceContainer(RequestParameterUtils.getSourceView(request), RequestParameterUtils.getTargetView(request));
- }
-
- private List<View> getStructureContainers(View view) {
- return new ConnectorUtils().getStructureContainers(view);
- }
-}
+/*****************************************************************************
+
+ * Copyright (c) 2011-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.uml.service.types.helper;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.IdentityCommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.service.types.command.ConnectorReorientCommand;
+import org.eclipse.papyrus.uml.service.types.utils.ConnectorUtils;
+import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
+import org.eclipse.uml2.uml.ConnectableElement;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.ConnectorEnd;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuredClassifier;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * Edit helper class for binary {@link Connector}
+ */
+public class ConnectorEditHelper extends ElementEditHelper {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ return new ConnectorReorientCommand(req);
+ }
+
+ /**
+ * Test if the relationship creation is allowed.
+ *
+ * @param source
+ * the relationship source can be null
+ * @param target
+ * the relationship target can be null
+ * @param sourceView
+ * the relationship graphical source can be null
+ * @param targetView
+ * the relationship graphical target can be null
+ * @return true if the creation is allowed
+ */
+ protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
+
+ if((source != null) && !(source instanceof ConnectableElement)) {
+ return false;
+ }
+
+ if((target != null) && !(target instanceof ConnectableElement)) {
+ return false;
+ }
+
+ if((sourceView != null) && (targetView != null)) {
+ // Cannot create a self connector on a view
+ if(sourceView == targetView) {
+ return false;
+ }
+
+ // Cannot create a connector from a view representing a Part to its own Port (or the opposite)
+ if((sourceView.getChildren().contains(targetView)) || (targetView.getChildren().contains(sourceView))) {
+ return false;
+ }
+
+ // Cannot connect two Port owned by the same view
+ if((sourceView.getElement() instanceof Port) && (targetView.getElement() instanceof Port)) {
+ if(ViewUtil.getContainerView(sourceView) == ViewUtil.getContainerView(targetView)) {
+ return false;
+ }
+ }
+
+ // Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
+ if(getStructureContainers(sourceView).contains(targetView) || getStructureContainers(targetView).contains(sourceView)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ EObject source = req.getSource();
+ EObject target = req.getTarget();
+
+ boolean noSourceOrTarget = (source == null || target == null);
+ boolean noSourceAndTarget = (source == null && target == null);
+ if(noSourceOrTarget && !noSourceAndTarget) {
+
+ if (!(source instanceof ConnectableElement)){
+ return UnexecutableCommand.INSTANCE;
+ }
+ // The request isn't complete yet. Return the identity command so
+ // that the create relationship gesture is enabled.
+ return IdentityCommand.INSTANCE;
+
+ }
+
+ if (source != null && target != null){
+ // Propose a semantic container for the new Connector.
+ StructuredClassifier proposedContainer = deduceContainer(req);
+ if(proposedContainer == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ EObject container = req.getContainer();
+ if (container != proposedContainer){
+ req.setContainer(proposedContainer);
+ return new CreateRelationshipCommand(req);
+ }
+
+ }
+
+ boolean umlStrict = true;
+ if (!req.getParameters().isEmpty()){
+ Object umlStrictParameter = req.getParameter(org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants.UML_STRICT);
+ if (umlStrictParameter instanceof Boolean){
+ umlStrict = (Boolean) umlStrictParameter;
+ }
+ }
+
+ boolean canCreate = true;
+
+ if (umlStrict){
+ canCreate = canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req));
+ }
+ if(!noSourceAndTarget && !canCreate) {
+ // Abort creation.
+ return UnexecutableCommand.INSTANCE;
+ }
+ return new CreateRelationshipCommand(req);
+ }
+
+ /**
+ * This method provides the source role provided as {@link ConfigureRequest} parameter.
+ *
+ * @return the target role
+ */
+ private ConnectableElement getSourceRole(IEditCommandRequest req) {
+ ConnectableElement result = null;
+ Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
+ if(paramObject instanceof ConnectableElement) {
+ result = (ConnectableElement)paramObject;
+ }
+
+ return result;
+ }
+
+ /**
+ * This method provides the target role provided as {@link ConfigureRequest} parameter.
+ *
+ * @return the target role
+ */
+ private ConnectableElement getTargetRole(IEditCommandRequest req) {
+ ConnectableElement result = null;
+ Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
+ if(paramObject instanceof ConnectableElement) {
+ result = (ConnectableElement)paramObject;
+ }
+
+ return result;
+ }
+
+ /**
+ * This method provides the source partWithPort provided as {@link ConfigureRequest} parameter.
+ *
+ * @return the target partWithPort
+ */
+ private Property getSourcePartWithPort(IEditCommandRequest req) {
+ Property result = null;
+ if(getSourceRole(req) instanceof Port) {
+ // Only look for PartWithPort if the role is a Port.
+
+ View parentView = ViewUtil.getContainerView(RequestParameterUtils.getSourceView(req));
+ EObject semanticParent = parentView.getElement();
+ if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
+ // Only add PartWithPort for assembly (not for delegation)
+ if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getTargetView(req))) {
+ result = (Property)semanticParent;
+ }
+ }
+
+ }
+ return result;
+ }
+
+ /**
+ * This method provides the target partWithPort provided as {@link ConfigureRequest} parameter.
+ *
+ * @return the target partWithPort
+ */
+ private Property getTargetPartWithPort(IEditCommandRequest req) {
+ Property result = null;
+ if(getTargetRole(req) instanceof Port) {
+ // Only look for PartWithPort if the role is a Port.
+
+ View parentView = ViewUtil.getContainerView(RequestParameterUtils.getTargetView(req));
+ EObject semanticParent = parentView.getElement();
+ if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
+ // Only add PartWithPort for assembly (not for delegation)
+ if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getSourceView(req))) {
+ result = (Property)semanticParent;
+ }
+ }
+
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getConfigureCommand(final ConfigureRequest req) {
+
+ final Connector connector = (Connector)req.getElementToConfigure();
+ final ConnectableElement sourceRole = getSourceRole(req);
+ final ConnectableElement targetRole = getTargetRole(req);
+ final Property sourcePartWithPort = getSourcePartWithPort(req);
+ final Property targetPartWithPort = getTargetPartWithPort(req);
+
+ ICommand configureCommand = new ConfigureElementCommand(req) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ if((sourceRole == null) || (targetRole == null)) {
+ //to allow creation from the ModelExplorer or from the table
+ //return CommandResult.newCancelledCommandResult();
+ }
+
+ // Add source connector end
+ ConnectorEnd sourceEnd = UMLFactory.eINSTANCE.createConnectorEnd();
+ sourceEnd.setRole(sourceRole);
+ sourceEnd.setPartWithPort(sourcePartWithPort);
+
+ // Add target connector end
+ ConnectorEnd targetEnd = UMLFactory.eINSTANCE.createConnectorEnd();
+ targetEnd.setRole(targetRole);
+ targetEnd.setPartWithPort(targetPartWithPort);
+
+ connector.getEnds().add(sourceEnd);
+ connector.getEnds().add(targetEnd);
+
+ return CommandResult.newOKCommandResult(connector);
+ }
+ };
+
+ return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
+ }
+
+ private StructuredClassifier deduceContainer(CreateRelationshipRequest request) {
+ return new ConnectorUtils().deduceContainer(RequestParameterUtils.getSourceView(request), RequestParameterUtils.getTargetView(request));
+ }
+
+ private List<View> getStructureContainers(View view) {
+ return new ConnectorUtils().getStructureContainers(view);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
index 1016cf9..b7e996d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
@@ -1,26 +1,29 @@
-/*****************************************************************************
- * Copyright (c) 2011-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.uml.service.types.utils;
-
-/**
- * <pre>
- * IDs of request parameters.
- * </pre>
- * @deprecated
- * @use org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants instead
- */
-@Deprecated
-public interface RequestParameterConstants extends org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants {
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011-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.uml.service.types.utils;
+
+/**
+ * <pre>
+ * IDs of request parameters.
+ * </pre>
+ * @use org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants instead
+ */
+public interface RequestParameterConstants extends org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants {
+
+ /**
+ * Parameter used to override som UML Constraint (for sysml)
+ *
+ */
+ public static final String UML_STRICT = "UML_STRICT"; //$NON-NLS-1$
+}
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 342ceb4..90dba9f 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 fa78234..c2a1014 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 31580e4..1210359 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 c69fa68..8fd7b27 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 581d4b8..bc3df80 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 1d64745..bb7a2a1 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 ee28e38..68d13cd 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 522436d..1e25e37 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 b476916..6c04433 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 fb793d1..f2a0e00 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 b554f66..0cb2a66 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 c59c529..9d65104 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 65d3696..96792ca 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 208eb5b..12f49ae 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 6277e86..464b3d1 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 6030bcc..aedf2fe 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 86ebc85..1a4fc9b 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 d4fe4835..119aee8 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 9f12d23..c08a697 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 e0a2db1..5bea2ab 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 2440b9d..57d4f1b 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 6c88348..a9fd198 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 5d2d4d0..44f7350 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 db6c6dc..1dc9c1b 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);
+ }
+ }
+
+}