Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-16 21:19:28 -0400
committerptessier2014-03-16 21:29:00 -0400
commit72945771d0654dbd3c81b774085fcb3d5281074f (patch)
tree4c77369e6e77164196eabf36a85dc89df1c6b13c /tests/junit
parentd25fd775ab2c111532c29074c6152c06c1991d8a (diff)
downloadorg.eclipse.papyrus-72945771d0654dbd3c81b774085fcb3d5281074f.tar.gz
org.eclipse.papyrus-72945771d0654dbd3c81b774085fcb3d5281074f.tar.xz
org.eclipse.papyrus-72945771d0654dbd3c81b774085fcb3d5281074f.zip
427025: [OCL For Papyrus] Cannot create OCL constraints in Luna
https://bugs.eclipse.org/bugs/show_bug.cgi?id=427025 update test and the code of dnd strategy in charge of the drop of classifier on constraint
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java20
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java20
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java6
3 files changed, 25 insertions, 21 deletions
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java
index a35852a66c9..45655953873 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java
@@ -49,7 +49,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropActor() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -62,7 +62,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropBlock() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -74,7 +74,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropConstraintBlock() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -93,7 +93,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropDataType() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -105,7 +105,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropEnumeration() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -132,7 +132,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropFlowSpecification() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -144,7 +144,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropInterface() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -183,7 +183,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropPrimitiveType() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -210,7 +210,7 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropSignal() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -236,6 +236,6 @@ public class TestNodeDropOnConstraint extends AbstractTest {
@Test
public void testDropValueType() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
}
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java
index 683d7f00db0..69a5896b709 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java
@@ -49,7 +49,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropActor() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -62,7 +62,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropBlock() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -74,7 +74,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropConstraintBlock() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -93,7 +93,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropDataType() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -105,7 +105,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropEnumeration() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -132,7 +132,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropFlowSpecification() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -144,7 +144,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropInterface() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -183,7 +183,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropPrimitiveType() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -210,7 +210,7 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropSignal() throws Exception {
EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
@Test
@@ -236,6 +236,6 @@ public class TestNodeDropOnConstraintCN extends AbstractTest {
@Test
public void testDropValueType() throws Exception {
EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
- dropFromModelExplorer(droppedElement, containerView, false);
+ dropFromModelExplorer(droppedElement, containerView, true);
}
}
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java
index a9eca5f678e..7840ed31a3e 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java
@@ -151,9 +151,10 @@ public class TestUtils {
// Get drop command
Command command = containerEditPart.getCommand(dropRequest);
-
+
// if the drop is not allowed the command should not be executable
if(!isAllowed) {
+
if((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
@@ -161,6 +162,9 @@ public class TestUtils {
}
} else {
+ if (command==null){
+ fail("The command is null! not normal.");
+ }
if((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {

Back to the top