Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrschnekenbu2012-02-23 13:21:40 +0000
committerrschnekenbu2012-02-23 13:21:40 +0000
commit8e407a3e9ab66c3e67d818b50fe2a5b0e9a0473e (patch)
treefe477f76ba967e43ce460917b33766d14d4cdd38 /tests
parent2fe642c0df689c164c2c1dc5c7911532b2986320 (diff)
downloadorg.eclipse.papyrus-8e407a3e9ab66c3e67d818b50fe2a5b0e9a0473e.tar.gz
org.eclipse.papyrus-8e407a3e9ab66c3e67d818b50fe2a5b0e9a0473e.tar.xz
org.eclipse.papyrus-8e407a3e9ab66c3e67d818b50fe2a5b0e9a0473e.zip
ASSIGNED - bug 370854: [SysML Block Definition Diagram] Exception raised when drawing a directed composition from a block to another association
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370854 ASSIGNED - bug 348651: [SysML Block Definition Diagram] Forbidden Association creation involving Actor is not detected before creation https://bugs.eclipse.org/bugs/show_bug.cgi?id=348651 Added 3 advices to test the creation of association: - 2 forbids the creation of an association on another one - one forbids the creation of an association on an actor depending on type of association and source/target. Warning: to remove creation of an association on another association, 2 helpers needed to be modified: - the first advice on association is there to forbid the beginning of the creation of the relationship, when the source is an association. the source element is used to compute the list of advices modifying the creation of the relationship. (source element == Association => advice = AssociationAdvice) - the 2nd advice on the package is there to forbid the 2nd and last step of the association creation, when the target is an association. The container of the future association is used to compute advice, not the target element! (target element = association && container = package => advice = PackageAdvice)
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/copypaste/TestCopyGraphicallyPasteBlock.java4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationForSourcesTest.java8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationFromElementTest.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkPrepareTest.java25
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintForSources.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromComment.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromConstraint.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyForSources.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyFromBlock.java4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationForSources.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationFromBlock.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationForSources.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageForSources.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedForSources.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeForSources.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedForSources.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneForSources.java4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneFromBlock.java8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedForSources.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedForSources.java2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedFromBlock.java1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java44
29 files changed, 125 insertions, 6 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch
index 12892cd43f4..bc8eda12e55 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch
@@ -32,7 +32,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.sysml.diagram.blockdefinition.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -XX:PermSize=256M -XX:MaxPermSize=256M -Xms40m -Xmx1024m &#13;&#10;-XX:+CMSPermGenSweepingEnabled &#13;&#10;-XX:+CMSClassUnloadingEnabled"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -XX:PermSize=512M -XX:MaxPermSize=512M -Xms40m -Xmx1024m&#13;&#10;-XX:+CMSClassUnloadingEnabled"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/copypaste/TestCopyGraphicallyPasteBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/copypaste/TestCopyGraphicallyPasteBlock.java
index 3dc39819954..609281d54e8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/copypaste/TestCopyGraphicallyPasteBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/copypaste/TestCopyGraphicallyPasteBlock.java
@@ -211,7 +211,7 @@ public class TestCopyGraphicallyPasteBlock extends AbstractTest {
Assert.assertEquals("Initial number of views do not fit expectations", 2, initialViews.size());
List<EObject> initialModelElements = new ArrayList<EObject>();
initialModelElements.addAll((List)getDiagramView().getElement().eGet(UMLPackage.eINSTANCE.getPackage_PackagedElement()));
- Assert.assertEquals("Initial number of model elemnts do not fit expectations", 2, initialViews.size());
+ Assert.assertEquals("Initial number of model elemnts do not fit expectations", 2, initialModelElements.size());
TestUtils.copyEditParts(Arrays.<Object> asList(blockEP1, blockEP2));
@@ -429,7 +429,7 @@ public class TestCopyGraphicallyPasteBlock extends AbstractTest {
Assert.assertTrue("Model element should be stereotyped", addedBlock2.getAppliedStereotype("SysML::Blocks::Block") != null);
// check name
- expectedName = "Copy_Of_Block1_1"; // Warning: this name already exists...
+ expectedName = "Copy_Of_Block_1"; // Warning: this name already exists...
Assert.assertEquals("Name of the element is not " + expectedName, expectedName, addedBlock2.getName());
// test undo
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationForSourcesTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationForSourcesTest.java
index e35bc87ab5f..6c021ff23f9 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationForSourcesTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationForSourcesTest.java
@@ -223,4 +223,12 @@ public class AbstractLinkCreationForSourcesTest extends AbstractLinkPrepareTest
View sourceView = enumerationLiteralSourceView;
createEdgeFromPalette(toolID, sourceView, null, isCreationAllowed.get(sourceView));
}
+
+ @Test
+ public void createLinkWithSourceAssociation() throws Exception {
+ View sourceView = associationSourceView;
+ boolean isAllowed = isCreationAllowed.get(sourceView);
+ createEdgeFromPalette(toolID, sourceView, null, isAllowed);
+ }
+
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationFromElementTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationFromElementTest.java
index 4e10ab6ed93..fb23edf23d3 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationFromElementTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkCreationFromElementTest.java
@@ -224,4 +224,10 @@ public class AbstractLinkCreationFromElementTest extends AbstractLinkPrepareTest
View targetView = enumerationLiteralTargetView;
createEdgeFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView));
}
+
+ @Test
+ public void createLinkWithTargetAssociation() throws Exception {
+ View targetView = associationTargetView;
+ createEdgeFromPalette(toolID, sourceView, targetView, isCreationAllowed.get(targetView));
+ }
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkPrepareTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkPrepareTest.java
index 53af967ccea..d76466eb154 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkPrepareTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/AbstractLinkPrepareTest.java
@@ -2,11 +2,14 @@ package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.link;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createEdgeFromPalette;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
@@ -14,6 +17,7 @@ import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -61,6 +65,10 @@ public class AbstractLinkPrepareTest extends AbstractTest {
// Inherited child label nodes
public static View slotSourceView, slotTargetView;
+ // links (creation of association on association)
+ public static View associationSourceView, associationTargetView;
+
+
public static Map<View, Boolean> isCreationAllowed = new HashMap<View, Boolean>();
@BeforeClass
@@ -178,4 +186,21 @@ public class AbstractLinkPrepareTest extends AbstractTest {
enumerationLiteralSourceView = createGraphicalNode(UMLElementTypes.ENUMERATION_LITERAL, UMLGraphicalTypes.SHAPE_UML_ENUMERATIONLITERAL_AS_LABEL_ID, enumLiteralSourceCpt);
enumerationLiteralTargetView = createGraphicalNode(UMLElementTypes.ENUMERATION_LITERAL, UMLGraphicalTypes.SHAPE_UML_ENUMERATIONLITERAL_AS_LABEL_ID, enumLiteralTargetCpt);
}
+
+ @BeforeClass
+ public static void prepareLinks() throws Exception {
+ // creates two blocks representation, and then creates an association between these 2 blocks
+ View sourceBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ View targetBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+
+ createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true);
+ createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true);
+ Set<Edge> edges = ViewUtil.getAllInnerEdges(sourceBlockView.getDiagram());
+ Assert.assertEquals("There should be 2 edges", 2, edges.size());
+ associationSourceView = edges.toArray(new Edge[]{})[0];
+ associationTargetView = edges.toArray(new Edge[]{})[1];
+ Assert.assertNotNull("association should not be null", associationSourceView);
+ Assert.assertNotNull("association should not be null", associationTargetView);
+
+ }
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintForSources.java
index dc84a517937..f84626f988d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintForSources.java
@@ -59,6 +59,7 @@ public class TestLinkCreationCommentConstraintForSources extends AbstractLinkCre
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromComment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromComment.java
index d3474525388..6c79d996f28 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromComment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromComment.java
@@ -64,6 +64,7 @@ public class TestLinkCreationCommentConstraintFromComment extends AbstractLinkCr
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromConstraint.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromConstraint.java
index 247e8c6f433..a993dd87f4f 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromConstraint.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationCommentConstraintFromConstraint.java
@@ -64,6 +64,7 @@ public class TestLinkCreationCommentConstraintFromConstraint extends AbstractLin
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyForSources.java
index 070158e5cb0..7618381270d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyForSources.java
@@ -59,6 +59,7 @@ public class TestLinkCreationDependencyForSources extends AbstractLinkCreationFo
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyFromBlock.java
index b8584a38c4b..4231221d267 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationDependencyFromBlock.java
@@ -62,7 +62,9 @@ public class TestLinkCreationDependencyFromBlock extends AbstractLinkCreationFro
isCreationAllowed.put(constraintCLNTargetView, false);
isCreationAllowed.put(constraintPropertyTargetView, false);
isCreationAllowed.put(flowPropertyTargetView, false);
- isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(enumerationLiteralTargetView, false);
+
+ isCreationAllowed.put(associationTargetView, true);
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationForSources.java
index a4a99ce033b..f3740adb1d8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationForSources.java
@@ -59,6 +59,7 @@ public class TestLinkCreationGeneralizationForSources extends AbstractLinkCreati
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationFromBlock.java
index 664a341923b..fbaa1a0c760 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationGeneralizationFromBlock.java
@@ -72,6 +72,7 @@ public class TestLinkCreationGeneralizationFromBlock extends AbstractLinkCreatio
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, true);
}
@Ignore("UML Rules not implemented.")
@@ -93,6 +94,7 @@ public class TestLinkCreationGeneralizationFromBlock extends AbstractLinkCreatio
createEdgeFromPalette(toolID, blockSourceView, blockSourceView, false);
}
+ @Ignore("This is not tested on creation. This should be tested on validation.")
@Test
public void createGeneralizationWithIndirectCycleIsForbidden() throws Exception {
View intermediate = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationForSources.java
index 3f2a0a7785b..833fcb9a189 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationForSources.java
@@ -59,6 +59,7 @@ public class TestLinkCreationInterfaceRealizationForSources extends AbstractLink
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationFromBlock.java
index c76aadd432f..26ff8888fc7 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationInterfaceRealizationFromBlock.java
@@ -64,6 +64,7 @@ public class TestLinkCreationInterfaceRealizationFromBlock extends AbstractLinkC
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageForSources.java
index ba17e8bef1e..d7a2d00055c 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageForSources.java
@@ -59,6 +59,7 @@ public class TestLinkCreationUsageForSources extends AbstractLinkCreationForSour
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageFromBlock.java
index 21def095f16..693e10b6569 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/TestLinkCreationUsageFromBlock.java
@@ -64,6 +64,7 @@ public class TestLinkCreationUsageFromBlock extends AbstractLinkCreationFromElem
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, true);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedForSources.java
index 57d6fe4c4da..4d4a7e06a00 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedForSources.java
@@ -60,6 +60,8 @@ public class TestLinkCreationAssociationCompositeDirectedForSources extends Abst
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
+
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedFromBlock.java
index 302cf6fb20a..3ad5a025c9f 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeDirectedFromBlock.java
@@ -65,5 +65,6 @@ public class TestLinkCreationAssociationCompositeDirectedFromBlock extends Abstr
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeForSources.java
index 1dced96efd4..893519c5dd0 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeForSources.java
@@ -60,6 +60,8 @@ public class TestLinkCreationAssociationCompositeForSources extends AbstractLink
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
+
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeFromBlock.java
index f46bfac07a8..3c1358a21bf 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationCompositeFromBlock.java
@@ -65,5 +65,6 @@ public class TestLinkCreationAssociationCompositeFromBlock extends AbstractLinkC
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedForSources.java
index 65ee45f5f6f..d9a54058215 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedForSources.java
@@ -60,6 +60,8 @@ public class TestLinkCreationAssociationNoneDirectedForSources extends AbstractL
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
+
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedFromBlock.java
index 14e1f2b89e7..1b6e60d5270 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneDirectedFromBlock.java
@@ -65,5 +65,6 @@ public class TestLinkCreationAssociationNoneDirectedFromBlock extends AbstractLi
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneForSources.java
index 0b4abce9a9a..5580364c229 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneForSources.java
@@ -58,7 +58,9 @@ public class TestLinkCreationAssociationNoneForSources extends AbstractLinkCreat
isCreationAllowed.put(constraintCLNSourceView, false);
isCreationAllowed.put(constraintPropertySourceView, false);
isCreationAllowed.put(flowPropertySourceView, false);
- isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(enumerationLiteralSourceView, false);
+
+ isCreationAllowed.put(associationSourceView, false);
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneFromBlock.java
index 19026a01da3..d86287fb26e 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationNoneFromBlock.java
@@ -11,6 +11,10 @@ import org.junit.BeforeClass;
*/
public class TestLinkCreationAssociationNoneFromBlock extends AbstractLinkCreationFromElementTest {
+
+ public TestLinkCreationAssociationNoneFromBlock() {
+ }
+
@BeforeClass
public static void initSource() throws Exception {
sourceView = blockSourceView;
@@ -63,7 +67,9 @@ public class TestLinkCreationAssociationNoneFromBlock extends AbstractLinkCreati
isCreationAllowed.put(constraintCLNTargetView, false);
isCreationAllowed.put(constraintPropertyTargetView, false);
isCreationAllowed.put(flowPropertyTargetView, false);
- isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(enumerationLiteralTargetView, false);
+
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedForSources.java
index 71f5e7114d3..9c6238c0962 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedForSources.java
@@ -60,6 +60,8 @@ public class TestLinkCreationAssociationSharedDirectedForSources extends Abstrac
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
+
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedFromBlock.java
index f1c53e73e2f..119c42d6690 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedDirectedFromBlock.java
@@ -65,5 +65,6 @@ public class TestLinkCreationAssociationSharedDirectedFromBlock extends Abstract
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedForSources.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedForSources.java
index 088213739fb..d49dc6957c8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedForSources.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedForSources.java
@@ -60,6 +60,8 @@ public class TestLinkCreationAssociationSharedForSources extends AbstractLinkCre
isCreationAllowed.put(flowPropertySourceView, false);
isCreationAllowed.put(enumerationLiteralSourceView, false);
+ isCreationAllowed.put(associationSourceView, false);
+
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedFromBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedFromBlock.java
index 7204d3a9a24..05e5960b10c 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedFromBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/link/association/TestLinkCreationAssociationSharedFromBlock.java
@@ -65,5 +65,6 @@ public class TestLinkCreationAssociationSharedFromBlock extends AbstractLinkCrea
isCreationAllowed.put(flowPropertyTargetView, false);
isCreationAllowed.put(enumerationLiteralTargetView, false);
+ isCreationAllowed.put(associationTargetView, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java
index 6fb2d57bd5f..ee4b821536d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java
@@ -7,17 +7,21 @@ import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.Edit
import java.util.ArrayList;
import java.util.Collection;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -35,6 +39,7 @@ import org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator;
import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Assert;
public class TestPrepareUtils {
@@ -110,6 +115,45 @@ public class TestPrepareUtils {
return (View)views.toArray()[0];
}
+ public static View createGraphicalLink(IElementType elementType, String graphicalType, View containerView, EditPart sourceEP, EditPart targetEP) throws Exception {
+ CreateConnectionViewRequest request = createConnectionRequest(elementType, sourceEP, targetEP);
+
+ Command command = targetEP.getCommand(request);
+ Assert.assertNotNull("Command to create graphical link should not be null", command);
+ Assert.assertTrue("Command should be executable", command.canExecute());
+
+ getDiagramCommandStack().execute(command);
+
+ IAdaptable viewAdapter = (IAdaptable)request.getNewObject();
+ View newView = (View)viewAdapter.getAdapter(View.class);
+ Assert.assertNotNull("View should not be null", newView);
+
+ EReference[] erefs = new EReference[]{ NotationPackage.eINSTANCE.getView_Element() };
+ @SuppressWarnings("unchecked")
+ Collection<View> views = (Collection<View>)EMFCoreUtil.getReferencers(newView, erefs);
+
+ return (View)views.toArray()[0];
+
+ }
+
+ public static CreateConnectionViewRequest createConnectionRequest(IElementType type, EditPart source, EditPart target) {
+ CreateConnectionViewRequest connectionRequest = CreateViewRequestFactory.getCreateConnectionRequest(type, Activator.DIAGRAM_PREFERENCES_HINT);
+
+ connectionRequest.setSourceEditPart(null);
+ connectionRequest.setTargetEditPart(source);
+ connectionRequest.setType(RequestConstants.REQ_CONNECTION_START);
+ source.getCommand(connectionRequest);
+
+ // Now, setup the request in preparation to get the
+ // connection end
+ // command.
+ connectionRequest.setSourceEditPart(source);
+ connectionRequest.setTargetEditPart(target);
+ connectionRequest.setType(RequestConstants.REQ_CONNECTION_END);
+ return connectionRequest;
+ }
+
+
public static View dropFromModelExplorer(IElementType elementType, View containerView) throws Exception {
EObject newObject = createElement(elementType, containerView);
return dropFromModelExplorer(newObject, containerView);

Back to the top