Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2012-03-12 14:35:40 +0000
committerytanguy2012-03-12 14:35:40 +0000
commit74e5d45dae40f88b7cb2f502b2f2942d378da403 (patch)
treef537bda043760d48e64770125885086f2ba4d37e
parent5aa8c6bc86546612fc7831853b7dc34301e88b64 (diff)
downloadorg.eclipse.papyrus-74e5d45dae40f88b7cb2f502b2f2942d378da403.tar.gz
org.eclipse.papyrus-74e5d45dae40f88b7cb2f502b2f2942d378da403.tar.xz
org.eclipse.papyrus-74e5d45dae40f88b7cb2f502b2f2942d378da403.zip
372355: [SysML Internal Block Diagram] JUnit tests for the Internal Block Diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372355
-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.java164
-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/TestLinkCreationConnectorForSources.java26
-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/TestLinkCreationConnectorFromActorPart.java54
-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.java54
-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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java57
-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/TestLinkCreationConnectorFromFlowPortOnPart.java43
-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/TestLinkCreationConnectorFromNestedActorPart.java57
-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/TestLinkCreationConnectorFromNestedPart.java57
-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/TestLinkCreationConnectorFromNestedProperty.java57
-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/TestLinkCreationConnectorFromNestedReference.java57
-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/TestLinkCreationConnectorFromNestedValue.java57
-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/TestLinkCreationConnectorFromPart.java54
-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.java54
-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/TestLinkCreationConnectorFromPortOnNestedPart.java57
-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/TestLinkCreationConnectorFromPortOnPart.java43
-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/TestLinkCreationConnectorFromProperty.java54
-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/TestLinkCreationConnectorFromReference.java54
-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/TestLinkCreationConnectorFromValue.java54
-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/AbstractLinkCreationForSourcesTest.java6
-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/AbstractLinkCreationFromElementTest.java8
-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/TestLinkCreationConnectorForSources.java28
-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/TestLinkCreationConnectorFromActorPart.java42
-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.java42
-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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java42
-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/TestLinkCreationConnectorFromFlowPortOnPart.java45
-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/TestLinkCreationConnectorFromNestedActorPart.java42
-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/TestLinkCreationConnectorFromNestedPart.java42
-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/TestLinkCreationConnectorFromNestedProperty.java42
-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/TestLinkCreationConnectorFromNestedReference.java42
-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/TestLinkCreationConnectorFromNestedValue.java42
-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/TestLinkCreationConnectorFromPart.java42
-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.java42
-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/TestLinkCreationConnectorFromPortOnNestedPart.java42
-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/TestLinkCreationConnectorFromPortOnPart.java42
-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/TestLinkCreationConnectorFromProperty.java42
-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/TestLinkCreationConnectorFromReference.java42
-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/TestLinkCreationConnectorFromValue.java42
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java100
38 files changed, 1350 insertions, 520 deletions
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/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
new file mode 100644
index 00000000000..40d7fe83629
--- /dev/null
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/creation/link/connector/AbstractLinkCreationFromElementTest.java
@@ -0,0 +1,164 @@
+/*****************************************************************************
+ * 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 createLinkWithSourceBlock() throws Exception {
+ View targetView = blockTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceActorPart() throws Exception {
+ View targetView = actorPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedActorPart() throws Exception {
+ View targetView = nestedActorPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourcePortOnBlock() throws Exception {
+ View targetView = portOnBlockTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourcePortOnPart() throws Exception {
+ View targetView = portOnPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourcePortOnNestedPart() throws Exception {
+ View targetView = portOnNestedPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceFlowPortOnBlock() throws Exception {
+ View targetView = flowportOnBlockTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceFlowPortOnPart() throws Exception {
+ View targetView = flowportOnPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceFlowPortOnNestedPart() throws Exception {
+ View targetView = flowportOnNestedPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourcePart() throws Exception {
+ View targetView = partTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedPart() throws Exception {
+ View targetView = nestedPartTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceProperty() throws Exception {
+ View targetView = propertyTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedProperty() throws Exception {
+ View targetView = nestedPropertyTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceReference() throws Exception {
+ View targetView = referenceTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedReference() throws Exception {
+ View targetView = nestedReferenceTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceValue() throws Exception {
+ View targetView = valueTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceNestedValue() throws Exception {
+ View targetView = nestedValueTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceComment() throws Exception {
+ View targetView = commentTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceCommentCN() throws Exception {
+ View targetView = commentCNTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceConstraint() throws Exception {
+ View targetView = constraintTargetView;
+ createEdgeConnectorFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView), expectedSourceNestedPath.get(targetView), expectedTargetNestedPath.get(targetView));
+ }
+
+ @Test
+ public void createLinkWithSourceConstraintCN() throws Exception {
+ View targetView = constraintCNTargetView;
+ 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/TestLinkCreationConnectorForSources.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/TestLinkCreationConnectorForSources.java
index c1d9977566e..30197da9a0c 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/TestLinkCreationConnectorForSources.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/TestLinkCreationConnectorForSources.java
@@ -23,43 +23,43 @@ import org.junit.BeforeClass;
* JUnit tests for Dependency link creation test (via palette tools).
*/
public class TestLinkCreationConnectorForSources extends AbstractLinkCreationForSourcesTest {
-
+
@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(blockSourceView, false);
-
+
isCreationAllowed.put(actorPartSourceView, true);
isCreationAllowed.put(nestedActorPartSourceView, true);
-
+
isCreationAllowed.put(portOnBlockSourceView, true);
isCreationAllowed.put(portOnPartSourceView, true);
isCreationAllowed.put(portOnNestedPartSourceView, true);
-
+
isCreationAllowed.put(flowportOnBlockSourceView, true);
isCreationAllowed.put(flowportOnPartSourceView, true);
isCreationAllowed.put(flowportOnNestedPartSourceView, true);
-
+
isCreationAllowed.put(partSourceView, true);
isCreationAllowed.put(nestedPartSourceView, true);
-
+
isCreationAllowed.put(propertySourceView, true);
isCreationAllowed.put(nestedPropertySourceView, true);
-
+
isCreationAllowed.put(referenceSourceView, true);
isCreationAllowed.put(nestedReferenceSourceView, true);
-
+
isCreationAllowed.put(valueSourceView, true);
isCreationAllowed.put(nestedValueSourceView, true);
-
+
isCreationAllowed.put(commentSourceView, false);
isCreationAllowed.put(commentCNSourceView, false);
isCreationAllowed.put(constraintSourceView, false);
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/TestLinkCreationConnectorFromActorPart.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/TestLinkCreationConnectorFromActorPart.java
index d01ef8ccc5b..47c94ad53e4 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/TestLinkCreationConnectorFromActorPart.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/TestLinkCreationConnectorFromActorPart.java
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromActorPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = actorPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/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 18667893b30..94298f6e833 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
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+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(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 part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/TestLinkCreationConnectorFromFlowPortOnNestedPart.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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java
index 433e80fc4af..d3c5115e906 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/TestLinkCreationConnectorFromFlowPortOnNestedPart.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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromFlowPortOnNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = flowportOnNestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
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();
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromFlowPortOnPart.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/TestLinkCreationConnectorFromFlowPortOnPart.java
index 7cba1ed253e..1e360b3d7c2 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/TestLinkCreationConnectorFromFlowPortOnPart.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/TestLinkCreationConnectorFromFlowPortOnPart.java
@@ -13,62 +13,75 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromFlowPortOnPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = flowportOnPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
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/TestLinkCreationConnectorFromNestedActorPart.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/TestLinkCreationConnectorFromNestedActorPart.java
index e7038d37fa4..9f9e923f501 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/TestLinkCreationConnectorFromNestedActorPart.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/TestLinkCreationConnectorFromNestedActorPart.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromNestedActorPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedActorPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromNestedPart.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/TestLinkCreationConnectorFromNestedPart.java
index 7f235938018..d91197945f7 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/TestLinkCreationConnectorFromNestedPart.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/TestLinkCreationConnectorFromNestedPart.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromNestedProperty.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/TestLinkCreationConnectorFromNestedProperty.java
index 2d2d64dbc99..739be150ab9 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/TestLinkCreationConnectorFromNestedProperty.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/TestLinkCreationConnectorFromNestedProperty.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromNestedProperty extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedPropertySourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromNestedReference.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/TestLinkCreationConnectorFromNestedReference.java
index 2e744924173..219e47746f8 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/TestLinkCreationConnectorFromNestedReference.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/TestLinkCreationConnectorFromNestedReference.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromNestedReference extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedReferenceSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromNestedValue.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/TestLinkCreationConnectorFromNestedValue.java
index fc220ec33d2..0246dd0bb97 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/TestLinkCreationConnectorFromNestedValue.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/TestLinkCreationConnectorFromNestedValue.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromNestedValue extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedValueSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromPart.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/TestLinkCreationConnectorFromPart.java
index 4c6adb14dc4..7ebd8dde25b 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/TestLinkCreationConnectorFromPart.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/TestLinkCreationConnectorFromPart.java
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = partSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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 680067aacdd..448d1353f0e 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
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+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(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 part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/TestLinkCreationConnectorFromPortOnNestedPart.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/TestLinkCreationConnectorFromPortOnNestedPart.java
index f6020b05f2a..cdf3a4dbabb 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/TestLinkCreationConnectorFromPortOnNestedPart.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/TestLinkCreationConnectorFromPortOnNestedPart.java
@@ -13,62 +13,89 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromPortOnNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = portOnNestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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);
+ }
+
+ expectedSourceNestedPath.put(blockTargetView, nestedPath);
+ expectedSourceNestedPath.put(actorPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(portOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnBlockTargetView, nestedPath);
+ expectedSourceNestedPath.put(flowportOnPartTargetView, nestedPath);
+ expectedSourceNestedPath.put(partTargetView, nestedPath);
+ expectedSourceNestedPath.put(propertyTargetView, nestedPath);
+ expectedSourceNestedPath.put(referenceTargetView, nestedPath);
+ expectedSourceNestedPath.put(valueTargetView, 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/TestLinkCreationConnectorFromPortOnPart.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/TestLinkCreationConnectorFromPortOnPart.java
index d4b36901756..dbf30719337 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/TestLinkCreationConnectorFromPortOnPart.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/TestLinkCreationConnectorFromPortOnPart.java
@@ -13,62 +13,75 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromPortOnPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = portOnPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
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/TestLinkCreationConnectorFromProperty.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/TestLinkCreationConnectorFromProperty.java
index b5b3fa5a026..5879a79ea2a 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/TestLinkCreationConnectorFromProperty.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/TestLinkCreationConnectorFromProperty.java
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromProperty extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = propertySourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/TestLinkCreationConnectorFromReference.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/TestLinkCreationConnectorFromReference.java
index bb43cc6e905..fe22794a930 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/TestLinkCreationConnectorFromReference.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/TestLinkCreationConnectorFromReference.java
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromReference extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = referenceSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/TestLinkCreationConnectorFromValue.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/TestLinkCreationConnectorFromValue.java
index 01edff63c58..dfa6c7286b3 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/TestLinkCreationConnectorFromValue.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/TestLinkCreationConnectorFromValue.java
@@ -13,62 +13,86 @@
*****************************************************************************/
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.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest;
+import org.eclipse.uml2.uml.Property;
import org.junit.BeforeClass;
/**
* JUnit tests for Connector link creation test (via palette tools).
*/
public class TestLinkCreationConnectorFromValue extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = valueSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
isCreationAllowed.put(commentTargetView, false);
isCreationAllowed.put(commentCNTargetView, false);
isCreationAllowed.put(constraintTargetView, false);
isCreationAllowed.put(constraintCNTargetView, false);
+
+ // Initialize nested property path for tests
+ Property part = (Property)partContainer1.getElement();
+ List<Property> nestedPath = Arrays.asList(new Property[]{ part });
+ 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, nestedPath);
+ expectedTargetNestedPath.put(flowportOnNestedPartTargetView, nestedPath);
+ expectedTargetNestedPath.put(nestedPartTargetView, nestedPath);
+ 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/encapsulated/AbstractLinkCreationForSourcesTest.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/AbstractLinkCreationForSourcesTest.java
index b54cb176858..43fccd0811d 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/AbstractLinkCreationForSourcesTest.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/AbstractLinkCreationForSourcesTest.java
@@ -22,10 +22,10 @@ import org.junit.BeforeClass;
* JUnit abstract tests for Link creation test (via palette tools).
*/
public class AbstractLinkCreationForSourcesTest extends org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationForSourcesTest {
-
+
@BeforeClass
public static void setPartBlockEncapsulated() throws Exception {
- TestPrepareUtils.setBlockEncapsulated((Element) (partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type())));
+ TestPrepareUtils.setBlockEncapsulated((Element)(partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type())));
}
-
+
}
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/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/encapsulated/AbstractLinkCreationFromElementTest.java
index 89e55e8d9d1..706e0c4c0b5 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/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/encapsulated/AbstractLinkCreationFromElementTest.java
@@ -21,11 +21,11 @@ import org.junit.BeforeClass;
/**
* JUnit tests for Link creation with specified source element (via palette tools).
*/
-public class AbstractLinkCreationFromElementTest extends org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.AbstractLinkCreationFromElementTest {
-
+public class AbstractLinkCreationFromElementTest extends org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.AbstractLinkCreationFromElementTest {
+
@BeforeClass
public static void setPartBlockEncapsulated() throws Exception {
- TestPrepareUtils.setBlockEncapsulated((Element) (partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type())));
+ TestPrepareUtils.setBlockEncapsulated((Element)(partContainer1.getElement().eGet(UMLPackage.eINSTANCE.getTypedElement_Type())));
}
-
+
}
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/TestLinkCreationConnectorForSources.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/TestLinkCreationConnectorForSources.java
index f898376eca6..aa5b7c9b4a9 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/TestLinkCreationConnectorForSources.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/TestLinkCreationConnectorForSources.java
@@ -22,43 +22,43 @@ import org.junit.BeforeClass;
* JUnit tests for Dependency link creation test (via palette tools).
*/
public class TestLinkCreationConnectorForSources extends AbstractLinkCreationForSourcesTest {
-
+
@BeforeClass
public static void initToolID() throws Exception {
- toolID = "internalblock.tool.connector";
- }
-
+ toolID = "internalblock.tool.connector";
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockSourceView, false);
-
+
isCreationAllowed.put(actorPartSourceView, true);
isCreationAllowed.put(nestedActorPartSourceView, true);
-
+
isCreationAllowed.put(portOnBlockSourceView, true);
isCreationAllowed.put(portOnPartSourceView, true);
isCreationAllowed.put(portOnNestedPartSourceView, true);
-
+
isCreationAllowed.put(flowportOnBlockSourceView, true);
isCreationAllowed.put(flowportOnPartSourceView, true);
isCreationAllowed.put(flowportOnNestedPartSourceView, true);
-
+
isCreationAllowed.put(partSourceView, true);
isCreationAllowed.put(nestedPartSourceView, true);
-
+
isCreationAllowed.put(propertySourceView, true);
isCreationAllowed.put(nestedPropertySourceView, true);
-
+
isCreationAllowed.put(referenceSourceView, true);
isCreationAllowed.put(nestedReferenceSourceView, true);
-
+
isCreationAllowed.put(valueSourceView, true);
isCreationAllowed.put(nestedValueSourceView, true);
-
+
isCreationAllowed.put(commentSourceView, false);
isCreationAllowed.put(commentCNSourceView, false);
isCreationAllowed.put(constraintSourceView, false);
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/TestLinkCreationConnectorFromActorPart.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/TestLinkCreationConnectorFromActorPart.java
index 18665b0df76..ac3b5bc575b 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/TestLinkCreationConnectorFromActorPart.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/TestLinkCreationConnectorFromActorPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromActorPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = actorPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, 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(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/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 f02fd2f99f1..85e1a667c02 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
@@ -13,61 +13,75 @@
*****************************************************************************/
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(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/TestLinkCreationConnectorFromFlowPortOnNestedPart.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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java
index 5f549d0a7ed..103ecda0f99 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/TestLinkCreationConnectorFromFlowPortOnNestedPart.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/TestLinkCreationConnectorFromFlowPortOnNestedPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromFlowPortOnNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = flowportOnNestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromFlowPortOnPart.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/TestLinkCreationConnectorFromFlowPortOnPart.java
index c593d8623e5..7652bc8669a 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/TestLinkCreationConnectorFromFlowPortOnPart.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/TestLinkCreationConnectorFromFlowPortOnPart.java
@@ -10,64 +10,79 @@
*
* CEA LIST - Initial API and implementation
*
- *****************************************************************************/package org.eclipse.papyrus.sysml.diagram.internalblock.tests.creation.link.connector.encapsulated;
+ *****************************************************************************/
+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 TestLinkCreationConnectorFromFlowPortOnPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
// Nested element are in the part that holds the flowport.
sourceView = flowportOnPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
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/TestLinkCreationConnectorFromNestedActorPart.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/TestLinkCreationConnectorFromNestedActorPart.java
index f131ab8ab89..2da59afac23 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/TestLinkCreationConnectorFromNestedActorPart.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/TestLinkCreationConnectorFromNestedActorPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromNestedActorPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedActorPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromNestedPart.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/TestLinkCreationConnectorFromNestedPart.java
index 05933ec1668..6c91a314ca8 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/TestLinkCreationConnectorFromNestedPart.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/TestLinkCreationConnectorFromNestedPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromNestedProperty.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/TestLinkCreationConnectorFromNestedProperty.java
index 868fe84a5f7..0383eeab53b 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/TestLinkCreationConnectorFromNestedProperty.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/TestLinkCreationConnectorFromNestedProperty.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromNestedProperty extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedPropertySourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromNestedReference.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/TestLinkCreationConnectorFromNestedReference.java
index 9b087f908ef..39124000297 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/TestLinkCreationConnectorFromNestedReference.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/TestLinkCreationConnectorFromNestedReference.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromNestedReference extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedReferenceSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromNestedValue.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/TestLinkCreationConnectorFromNestedValue.java
index 080b6e22416..9f84764295c 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/TestLinkCreationConnectorFromNestedValue.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/TestLinkCreationConnectorFromNestedValue.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromNestedValue extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = nestedValueSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromPart.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/TestLinkCreationConnectorFromPart.java
index 8ae5ac65718..a575ffde15a 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/TestLinkCreationConnectorFromPart.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/TestLinkCreationConnectorFromPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = partSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, 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(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 049b136da94..50624cdcde8 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
@@ -13,61 +13,75 @@
*****************************************************************************/
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(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/TestLinkCreationConnectorFromPortOnNestedPart.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/TestLinkCreationConnectorFromPortOnNestedPart.java
index fb13f723a55..613b3dc692c 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/TestLinkCreationConnectorFromPortOnNestedPart.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/TestLinkCreationConnectorFromPortOnNestedPart.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromPortOnNestedPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = portOnNestedPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, false);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, false);
isCreationAllowed.put(portOnPartTargetView, false);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, false);
isCreationAllowed.put(flowportOnPartTargetView, false);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, false);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, false);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, false);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, false);
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
+ 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/TestLinkCreationConnectorFromPortOnPart.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/TestLinkCreationConnectorFromPortOnPart.java
index 75a4af9b96d..ca0f6e79820 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/TestLinkCreationConnectorFromPortOnPart.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/TestLinkCreationConnectorFromPortOnPart.java
@@ -13,62 +13,76 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromPortOnPart extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
// Nested element are in the part that holds the port.
sourceView = portOnPartSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, true);
-
+
isCreationAllowed.put(portOnBlockTargetView, true);
isCreationAllowed.put(portOnPartTargetView, true);
isCreationAllowed.put(portOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(flowportOnBlockTargetView, true);
isCreationAllowed.put(flowportOnPartTargetView, true);
isCreationAllowed.put(flowportOnNestedPartTargetView, true);
-
+
isCreationAllowed.put(partTargetView, true);
isCreationAllowed.put(nestedPartTargetView, true);
-
+
isCreationAllowed.put(propertyTargetView, true);
isCreationAllowed.put(nestedPropertyTargetView, true);
-
+
isCreationAllowed.put(referenceTargetView, true);
isCreationAllowed.put(nestedReferenceTargetView, true);
-
+
isCreationAllowed.put(valueTargetView, true);
isCreationAllowed.put(nestedValueTargetView, true);
-
+
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/TestLinkCreationConnectorFromProperty.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/TestLinkCreationConnectorFromProperty.java
index 166659f0113..b1f5c126c17 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/TestLinkCreationConnectorFromProperty.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/TestLinkCreationConnectorFromProperty.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromProperty extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = propertySourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, 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(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/TestLinkCreationConnectorFromReference.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/TestLinkCreationConnectorFromReference.java
index cf9719b4f4b..ac67a9e38f7 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/TestLinkCreationConnectorFromReference.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/TestLinkCreationConnectorFromReference.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromReference extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = referenceSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, 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(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/TestLinkCreationConnectorFromValue.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/TestLinkCreationConnectorFromValue.java
index 59e961dd60c..d55a19969e3 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/TestLinkCreationConnectorFromValue.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/TestLinkCreationConnectorFromValue.java
@@ -13,61 +13,75 @@
*****************************************************************************/
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 TestLinkCreationConnectorFromValue extends AbstractLinkCreationFromElementTest {
-
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = valueSourceView;
- }
-
+ }
+
@BeforeClass
public static void initToolID() throws Exception {
toolID = "internalblock.tool.connector";
- }
-
+ }
+
@BeforeClass
public static void initExpectedResults() throws Exception {
-
+
// Initialize source creation results
isCreationAllowed = new HashMap<View, Boolean>();
-
+
isCreationAllowed.put(blockTargetView, false);
isCreationAllowed.put(actorPartTargetView, true);
isCreationAllowed.put(nestedActorPartTargetView, 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(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/utils/TestUtils.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
index 87782b39d18..6dd2f2ef999 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
@@ -49,6 +49,7 @@ import org.eclipse.gmf.runtime.common.ui.action.internal.actions.global.GlobalCo
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand;
import org.eclipse.gmf.runtime.diagram.ui.menus.PopupMenu;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -70,7 +71,9 @@ import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.ConnectorEnd;
+import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -338,16 +341,11 @@ public class TestUtils {
}
public static void createEdgeFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed) throws Exception {
-
- if(isAllowed) {
- createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, true);
- } else {
- createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, false);
- }
-
+ // Execute command only when the command is expected to be executable
+ createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, isAllowed);
}
- public static void createEdgeFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute) throws Exception {
+ public static EObject createEdgeFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute) throws Exception {
// Find palette tool to simulate element creation and prepare request
Tool tool = getPaletteTool(toolId);
@@ -363,7 +361,7 @@ public class TestUtils {
if(targetView == null) { // Only test behavior on source
if(!isAllowed) {
// Current behavior matches the expected results
- return;
+ return null;
} else {
fail("The command should be executable.");
}
@@ -378,7 +376,7 @@ public class TestUtils {
fail("The command should not be executable.");
} else {
// Current behavior matches the expected results - no execution test.
- return;
+ return null;
}
} else { // The command is executable and a target is provided - continue the test
@@ -393,7 +391,7 @@ public class TestUtils {
if((tgtCommand == null) || !(tgtCommand.canExecute())) { // Non-executable command
if(!isAllowed) {
// Current behavior matches the expected results
- return;
+ return null;
} else {
fail("The command should be executable.");
}
@@ -405,6 +403,23 @@ public class TestUtils {
// Current behavior matches the expected results
if(execute) { // Test command execution
defaultExecutionTest(tgtCommand);
+
+ // Retrieve created object via nested ElementAndViewCreationRequest.
+ CreateConnectionViewAndElementRequest subRequest = (CreateConnectionViewAndElementRequest)createRequest.getAllRequests().get(0);
+
+ // Specific case for comment - constraint link button
+ if("internalblock.tool.comment_constraint_link".equals(toolId)) {
+ if(sourceView.getElement() instanceof Comment) {
+ subRequest = (CreateConnectionViewAndElementRequest)createRequest.getAllRequests().get(0);
+ } else if(sourceView.getElement() instanceof Constraint) {
+ subRequest = (CreateConnectionViewAndElementRequest)createRequest.getAllRequests().get(1);
+ } else {
+ return null;
+ }
+ }
+
+ View newView = (View)subRequest.getConnectionViewDescriptor().getAdapter(View.class);
+ return newView.getElement();
}
// Test the results then
@@ -414,6 +429,49 @@ public class TestUtils {
}
}
+ return null;
+ }
+
+ public static void createEdgeConnectorFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, List<Property> nestedSourcePath, List<Property> nestedTargetPath) throws Exception {
+ createEdgeConnectorFromPalette(toolId, sourceView, targetView, isAllowed, isAllowed, nestedSourcePath, nestedTargetPath);
+ }
+
+ public static void createEdgeConnectorFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute, List<Property> nestedSourcePath, List<Property> nestedTargetPath) throws Exception {
+ EObject newLink = createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, execute);
+
+ // Abort if the command is not supposed to be executable
+ if(!isAllowed) {
+ return;
+ }
+
+ if((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
+ fail("No edge or unexpected kind of edge created.");
+ }
+
+ // If previous test have not failed the execution / undo / re-do has been done
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)newLink;
+
+ // Test source connector end
+ NestedConnectorEnd sourceNestedConnectorEnd = UMLUtil.getStereotypeApplication(connector.getEnds().get(0), NestedConnectorEnd.class);
+ if(nestedSourcePath.isEmpty()) {
+ Assert.assertNull("No nested connector end stereotype should be applied on source.", sourceNestedConnectorEnd);
+ } else {
+ Assert.assertNotNull("Nested connector end stereotype should be applied on source.", sourceNestedConnectorEnd);
+ if(!sourceNestedConnectorEnd.getPropertyPath().equals(nestedSourcePath)) {
+ fail("The nested property path is incorrect for source.");
+ }
+ }
+
+ // Test target connector end
+ NestedConnectorEnd targetNestedConnectorEnd = UMLUtil.getStereotypeApplication(connector.getEnds().get(1), NestedConnectorEnd.class);
+ if(nestedTargetPath.isEmpty()) {
+ Assert.assertNull("No nested connector end stereotype should be applied on target.", targetNestedConnectorEnd);
+ } else {
+ Assert.assertNotNull("Nested connector end stereotype should be applied on target.", targetNestedConnectorEnd);
+ if(!targetNestedConnectorEnd.getPropertyPath().equals(nestedTargetPath)) {
+ fail("The nested property path is incorrect for target.");
+ }
+ }
}
public static void reorientRelationshipSource(View relationshipView, View newSourceView, boolean isAllowed) throws Exception {
@@ -425,7 +483,7 @@ public class TestUtils {
}
public static void reorientRelationship(Connector relationshipView, View newEndView, int reorientDirection, boolean isAllowed) throws Exception {
-
+
// Prepare request and add
String reconnectDirection = (ReorientRelationshipRequest.REORIENT_SOURCE == reorientDirection) ? RequestConstants.REQ_RECONNECT_SOURCE : RequestConstants.REQ_RECONNECT_TARGET;
@@ -467,7 +525,7 @@ public class TestUtils {
List<Property> nestedPath = Collections.emptyList();
reorientConnectorTarget((Connector)relationshipView, newTargetView, isAllowed, nestedPath);
}
-
+
public static void reorientConnectorSource(View relationshipView, View newSourceView, boolean isAllowed, List<Property> nestedPath) throws Exception {
reorientConnector((Connector)relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed, nestedPath);
}
@@ -475,30 +533,30 @@ public class TestUtils {
public static void reorientConnectorTarget(View relationshipView, View newTargetView, boolean isAllowed, List<Property> nestedPath) throws Exception {
reorientConnector((Connector)relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed, nestedPath);
}
-
+
public static void reorientConnector(Connector relationshipView, View newEndView, int reorientDirection, boolean isAllowed, List<Property> nestedPath) throws Exception {
reorientRelationship(relationshipView, newEndView, reorientDirection, isAllowed);
-
+
// Abort if the command is not supposed to be executable
- if (! isAllowed) {
+ if(!isAllowed) {
return;
}
-
+
// If previous test have not failed the execution / undo / re-do has been done
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) relationshipView.getElement();
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)relationshipView.getElement();
ConnectorEnd modifiedConnectorEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? connector.getEnds().get(0) : connector.getEnds().get(1);
NestedConnectorEnd nestedConnectorEnd = UMLUtil.getStereotypeApplication(modifiedConnectorEnd, NestedConnectorEnd.class);
- if (nestedPath.isEmpty()) {
+ if(nestedPath.isEmpty()) {
Assert.assertNull("No nested connector end stereotype should be applied.", nestedConnectorEnd);
} else {
Assert.assertNotNull("Nested connector end stereotype should be applied.", nestedConnectorEnd);
- if (! nestedConnectorEnd.getPropertyPath().equals(nestedPath)) {
+ if(!nestedConnectorEnd.getPropertyPath().equals(nestedPath)) {
fail("The nested property path is incorrect.");
}
}
}
-
+
/**
* Copy the list of objects into the Clipboard
*

Back to the top