Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorytanguy2011-07-04 12:32:28 +0000
committerytanguy2011-07-04 12:32:28 +0000
commitbe6fc34ca3a9bb19983a34c9ec77ae97aef565da (patch)
tree7265f201e62c94e3725c184152dcf632e6075163 /tests
parent83231690557c3478309df007c01c89e05939b555 (diff)
downloadorg.eclipse.papyrus-be6fc34ca3a9bb19983a34c9ec77ae97aef565da.tar.gz
org.eclipse.papyrus-be6fc34ca3a9bb19983a34c9ec77ae97aef565da.tar.xz
org.eclipse.papyrus-be6fc34ca3a9bb19983a34c9ec77ae97aef565da.zip
NEW - bug 349792: [SysML Block Definition Diagram] JUnit tests for the Block Definition Diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349792
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.launch10
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java67
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java3
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java18
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java18
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java10
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java10
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java11
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java21
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java21
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java21
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java25
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java21
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java23
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromDiagram.java202
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromModel.java202
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/TestNodeDropOnDiagram.java186
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActor.java231
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorOperationCompartment.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorPropertyCompartment.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlock.java276
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockConstraintCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockFlowPortCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockOperationCompartment.java297
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPartCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPortCompartment.java297
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPropertyCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockReferenceCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockValueCompartment.java296
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlock.java241
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockConstraintCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockParameterCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataType.java241
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypeOperationCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypePropertyCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDimension.java226
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumeration.java246
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumerationCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecification.java236
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecificationCompartment.java248
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterface.java241
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfaceOperationCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfacePropertyCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnPrimitiveType.java231
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignal.java236
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalOperationCompartment.java16
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalPropertyCompartment.java254
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnUnit.java226
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueType.java241
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypeOperationCompartment.java255
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypePropertyCompartment.java255
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnComment.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnCommentCN.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecification.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCN.java221
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartment.java229
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartmentCN.java229
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModel.java306
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModelCN.java306
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModelCompartment.java325
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModelCompartmentCN.java325
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnPackage.java306
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnPackageCN.java306
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnPackageCompartment.java325
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnPackageCompartmentCN.java325
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllCreationCustomTests.java80
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllCreationInheritedTests.java43
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllDiagramTests.java23
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllDnDCustomTests.java80
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllDnDInheritedTests.java44
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllTests.java17
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/EditorUtils.java117
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestPrepareUtils.java129
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/TestUtils.java225
115 files changed, 13967 insertions, 363 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 6d8828eef35..ee51d9f2d58 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
@@ -14,23 +14,23 @@
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests"/>
+<listEntry value="/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/suites/AllTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
+<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.papyrus.sysml.diagram.blockdefinition.tests"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.suites.AllTests"/>
<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=64M -XX:MaxPermSize=128M -Xms40m -Xmx1024m"/>
+<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="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/AbstractTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java
index 738904c73a9..e4f17e73e6f 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java
@@ -1,14 +1,10 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests;
-
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator;
-import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
@@ -24,46 +20,43 @@ public abstract class AbstractTest {
public static boolean isInitialized = false;
public static IEditorPart editor = null;
+
+ public static String editorID = "org.eclipse.papyrus.core.papyrusEditor";
- @BeforeClass public static void openPapyrusWithAnEmptyProject() throws Exception {
-
- // Only initialize once...
- if(!isInitialized) {
- isInitialized = true;
-
- try {
-
- // Prepare new project for tests
- IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
- if(!testProject.exists()) {
- testProject.create(new NullProgressMonitor());
- }
- if(!testProject.isOpen()) {
- testProject.open(new NullProgressMonitor());
- }
+ @BeforeClass
+ public static void openPapyrusWithAnEmptyProject() throws Exception {
- // Copy test model from bundle to the test project
- IFile model_di = testProject.getFile("ModelWithBDD.di");
- IFile model_no = testProject.getFile("ModelWithBDD.notation");
- IFile model_uml = testProject.getFile("ModelWithBDD.uml");
+ // Prepare new project for tests
+ IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
+ if(!testProject.exists()) {
+ testProject.create(new NullProgressMonitor());
+ }
- model_di.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
- model_no.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
- model_uml.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
+ if(!testProject.isOpen()) {
+ testProject.open(new NullProgressMonitor());
+ }
- // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(model_di.getName());
- editor = (CoreMultiDiagramEditor)page.openEditor(new FileEditorInput(model_di), desc.getId()).getAdapter(CoreMultiDiagramEditor.class);
+ // Copy EmptyModel from bundle to the test project
+ IFile emptyModel_di = testProject.getFile("ModelWithBDD.di");
+ IFile emptyModel_no = testProject.getFile("ModelWithBDD.notation");
+ IFile emptyModel_uml = testProject.getFile("ModelWithBDD.uml");
- } catch (Exception e) {
- throw new Exception("Papyrus initialization failed (" + e.getMessage() + ").", e); // $NON-NLS-1$
- }
+ if(!isInitialized) {
+ isInitialized = true;
+ emptyModel_di.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
+ emptyModel_no.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
+ emptyModel_uml.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
}
-
+
+ // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ editor = page.openEditor(new FileEditorInput(emptyModel_di), editorID);
}
- @AfterClass public static void closePapyrusAndCleanProject() throws Exception {
- editor.doSave(new NullProgressMonitor());
+ @AfterClass
+ public static void closePapyrusAndCleanProject() throws Exception {
+ // Close the editor without saving content created during tests
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.closeEditor(editor, false);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java
index b52aeec5097..50ccaf9bbe3 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java
@@ -1,6 +1,7 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
import org.junit.Test;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java
index 6151b5d26b6..b2e044f3652 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+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.BeforeClass;
import org.junit.Test;
@@ -20,18 +26,16 @@ public class TestNodeCreationOnActor extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.actor", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_ACTOR_AS_CLASSIFIER_ID);
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
+ // prepare container
+ containerView = createGraphicalNode(UMLElementTypes.ACTOR, UMLGraphicalTypes.SHAPE_UML_ACTOR_AS_CLASSIFIER_ID, getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java
index a799bde2b2a..bc9629ab60d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java
@@ -10,6 +10,8 @@ import org.junit.Test;
public class TestNodeCreationOnActorOperationCompartment extends AbstractTest {
@Ignore("Actor should not have operations compartment.")
- @Test public void warning() {};
-
+ @Test
+ public void warning() {
+ };
+
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java
index 4c49b808eb9..c856cb88f66 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java
@@ -10,6 +10,8 @@ import org.junit.Test;
public class TestNodeCreationOnActorPropertyCompartment extends AbstractTest {
@Ignore("Actor should not have properties compartment.")
- @Test public void warning() {};
-
+ @Test
+ public void warning() {
+ };
+
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java
index f02c3068bf8..4b2805a8739 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,16 @@ public class TestNodeCreationOnBlock extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
+ // prepare container
+ containerView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java
index 3ae07d9e1ce..7db6597ef22 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockConstraintCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java
index 419f8ad2a9d..d47a86a81e8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockFlowPortCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java
index 2dc2f7d7458..25efa0a7dcb 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -34,7 +36,7 @@ public class TestNodeCreationOnBlockOperationCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java
index 2be01dfbec8..d4730791ded 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockPartCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java
index 2506fc48816..82cac10610a 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -34,7 +36,7 @@ public class TestNodeCreationOnBlockPortCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java
index dbe63ec5a06..cab8203e745 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockPropertyCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare Block for test.");
+ throw new Exception("Unable to prepare Block for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java
index 55155dc4796..510e0bc4b45 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockReferenceCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java
index c973d83877f..8324379613c 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnBlockValueCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java
index 2208668eb89..8d6296cf25e 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnConstraintBlock extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.constraintblock", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnConstraintBlock extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java
index 6865665badc..efdac3e550e 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -33,7 +35,7 @@ public class TestNodeCreationOnConstraintBlockConstraintCompartment extends Abst
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java
index c2288a62f38..c85d4ed1219 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnConstraintBlockParameterCompartment extends Abstr
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java
index 9881727a88d..dd6712b487a 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnDataType extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.datatype", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnDataType extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java
index fa3fd616b1b..e7f77822851 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnDataTypeOperationCompartment extends AbstractTest
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java
index 832fac2f2ad..3889931e2de 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnDataTypePropertyCompartment extends AbstractTest
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java
index 607f2928808..84f828773fa 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnDimension extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.dimension", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_DIMENSION_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnDimension extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java
index 98b2b7e3897..1babe1270f5 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnEnumeration extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.enumeration", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_ENUMERATION_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnEnumeration extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java
index baaac754d06..f0c9a455207 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnEnumerationLiteralCompartment extends AbstractTes
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java
index b7f73a165be..c57af5a940d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnFlowSpecification extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.flowspecification", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_FLOWSPECIFICATION_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnFlowSpecification extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java
index 644e1e38051..5b537f2c0c0 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnFlowSpecificationFlowCompartment extends Abstract
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java
index e03baf86a9f..78017e3ee4e 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnInterface extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.interface", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnInterface extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java
index 85f3040ef9f..dbff20e1bbb 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnInterfaceOperationCompartment extends AbstractTes
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java
index 3a8c6ab7a5b..15e7eaf3290 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnInterfacePropertyCompartment extends AbstractTest
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java
index 2de455620f1..5a9140c85cb 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java
@@ -1,12 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -21,8 +24,7 @@ public class TestNodeCreationOnPrimitiveType extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.primitivetype", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_PRIMITIVETYPE_AS_CLASSIFIER_ID);
@@ -32,7 +34,7 @@ public class TestNodeCreationOnPrimitiveType extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java
index 3731e129264..4f814687b60 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java
@@ -1,12 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -21,8 +24,7 @@ public class TestNodeCreationOnSignal extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.signal", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_SIGNAL_AS_CLASSIFIER_ID);
@@ -32,7 +34,7 @@ public class TestNodeCreationOnSignal extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java
index a6e25876731..00ab5f98924 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java
@@ -10,6 +10,8 @@ import org.junit.Test;
public class TestNodeCreationOnSignalOperationCompartment extends AbstractTest {
@Ignore("Signal should not have operations compartment.")
- @Test public void warning() {};
-
+ @Test
+ public void warning() {
+ };
+
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java
index 894cec839e3..23afb0df1bb 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -35,7 +35,7 @@ public class TestNodeCreationOnSignalPropertyCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java
index 4d880fc7997..2c0fcb712b6 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnUnit extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.unit", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_UNIT_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnUnit extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java
index 54ae7689f7d..e5354fab1ab 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,8 +24,7 @@ public class TestNodeCreationOnValueType extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- //
+ createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
createFromPalette("blockdefinition.tool.valuetype", getDiagramView(), true);
containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID);
@@ -31,7 +34,7 @@ public class TestNodeCreationOnValueType extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java
index 52ea99eb234..38827f61247 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -36,7 +36,7 @@ public class TestNodeCreationOnValueTypeOperationCompartment extends AbstractTes
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java
index 40e2d0bd1bd..d420e1a20a1 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java
@@ -1,8 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -36,7 +36,7 @@ public class TestNodeCreationOnValueTypePropertyCompartment extends AbstractTest
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java
index abce3b999b5..cf360cf0dc6 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,15 @@ public class TestNodeCreationOnComment extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.comment", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.COMMENT.getSemanticHint());
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java
index eb3ff4af0e9..d1b586ad447 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,27 +26,22 @@ public class TestNodeCreationOnCommentCN extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
- createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
- View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
-
// Ensure the compartment is visible (required for EditPart to be found)
if(!topNodeCompartmentView.isVisible()) {
changeVisibility(topNodeCompartmentView);
}
- createFromPalette("blockdefinition.tool.comment", topNodeCompartmentView, true);
- containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.COMMENT_CN.getSemanticHint());
-
+ containerView = createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), topNodeCompartmentView);
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java
index a9e98273fbc..c29eff8fbae 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,15 @@ public class TestNodeCreationOnConstraint extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.constraint", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.CONSTRAINT.getSemanticHint());
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java
index 91a675d66b9..92a59804769 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,27 +26,22 @@ public class TestNodeCreationOnConstraintCN extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
- createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
- View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
-
// Ensure the compartment is visible (required for EditPart to be found)
if(!topNodeCompartmentView.isVisible()) {
changeVisibility(topNodeCompartmentView);
}
- createFromPalette("blockdefinition.tool.constraint", topNodeCompartmentView, true);
- containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.CONSTRAINT_CN.getSemanticHint());
-
+ containerView = createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), topNodeCompartmentView);
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java
index 4e842993f98..4e7e60f59b1 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,15 @@ public class TestNodeCreationOnInstanceSpecification extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force inherited provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.instancespecification", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint());
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint(), getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
@@ -162,9 +163,7 @@ public class TestNodeCreationOnInstanceSpecification extends AbstractTest {
@Test
public void createSlot() throws Exception {
- // Current implementation re-target the command creation to the compartment
- // (when visible which is the case in default creation)
- createFromPalette("blockdefinition.tool.slot", containerView, true);
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
}
@Test
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java
index f61cbbc7466..f8c4ce59a81 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,27 +26,22 @@ public class TestNodeCreationOnInstanceSpecificationCN extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
- createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
- View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
-
// Ensure the compartment is visible (required for EditPart to be found)
if(!topNodeCompartmentView.isVisible()) {
changeVisibility(topNodeCompartmentView);
}
- createFromPalette("blockdefinition.tool.instancespecification", topNodeCompartmentView, true);
- containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.INSTANCE_SPECIFICATION_CN.getSemanticHint());
-
+ containerView = createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint(), topNodeCompartmentView);
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
@@ -171,9 +172,7 @@ public class TestNodeCreationOnInstanceSpecificationCN extends AbstractTest {
@Test
public void createSlot() throws Exception {
- // Current implementation re-target the command creation to the compartment
- // (when visible which is the case in default creation)
- createFromPalette("blockdefinition.tool.slot", containerView, true);
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
}
@Test
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java
index d857c1af87c..c1e639dc924 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -38,7 +40,7 @@ public class TestNodeCreationOnInstanceSpecificationCompartment extends Abstract
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java
index ef7ab1c4231..696c9cdd2f3 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -46,7 +48,7 @@ public class TestNodeCreationOnInstanceSpecificationCompartmentCN extends Abstra
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java
index fa3054380a6..45768e51851 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,15 @@ public class TestNodeCreationOnModel extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java
index 42f4496eb7c..072142fc73e 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,27 +26,22 @@ public class TestNodeCreationOnModelCN extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
- createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
- View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
-
// Ensure the compartment is visible (required for EditPart to be found)
if(!topNodeCompartmentView.isVisible()) {
changeVisibility(topNodeCompartmentView);
}
- createFromPalette("blockdefinition.tool.model", topNodeCompartmentView, true);
- containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.MODEL_CN.getSemanticHint());
-
+ containerView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL_CN.getSemanticHint(), topNodeCompartmentView);
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java
index dc35ee9f096..ddbd8f7c06f 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -38,7 +40,7 @@ public class TestNodeCreationOnModelCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java
index 5495a4fd636..00bbe93bb70 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -46,7 +48,7 @@ public class TestNodeCreationOnModelCompartmentCN extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java
index ce68dcff310..57142fcad10 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java
@@ -1,11 +1,15 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+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.createFromPalette;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,18 +24,15 @@ public class TestNodeCreationOnPackage extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE.getSemanticHint(), getDiagramView());
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java
index 53aa97af9f1..8b32a5e2ac8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java
@@ -1,11 +1,17 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createGraphicalNode;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
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;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -20,27 +26,22 @@ public class TestNodeCreationOnPackageCN extends AbstractTest {
public static void prepareContainerForTest() throws Exception {
try {
// force custom provider loading...
- createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
- //
-
- createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
- View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
- View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.PACKAGE_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+ createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ View topNodeView = createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
// Ensure the compartment is visible (required for EditPart to be found)
if(!topNodeCompartmentView.isVisible()) {
changeVisibility(topNodeCompartmentView);
}
- createFromPalette("blockdefinition.tool.package", topNodeCompartmentView, true);
- containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.PACKAGE_CN.getSemanticHint());
-
+ containerView = createGraphicalNode(UMLElementTypes.PACKAGE, ElementTypes.PACKAGE_CN.getSemanticHint(), topNodeCompartmentView);
if(containerView == null) {
throw new Exception("Unable to prepare container for test.");
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java
index 7a96fd2cf38..a501a983547 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -38,7 +40,7 @@ public class TestNodeCreationOnPackageCompartment extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java
index 61f62a511f4..19af2e33870 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java
@@ -1,6 +1,8 @@
package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
-import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.createFromPalette;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.View;
@@ -46,7 +48,7 @@ public class TestNodeCreationOnPackageCompartmentCN extends AbstractTest {
}
} catch (Exception e) {
- throw new Exception("Unable to prepare container for test.");
+ throw new Exception("Unable to prepare container for test.", e);
}
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromDiagram.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromDiagram.java
new file mode 100644
index 00000000000..13b6e51ecd6
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromDiagram.java
@@ -0,0 +1,202 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.delete;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.dropFromModelExplorer;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.deleteView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+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;
+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.Test;
+
+/**
+ * JUnit tests for element Delete test (via palette tools) in diagram.
+ */
+public class TestNodeBasicDeleteFromDiagram extends AbstractTest {
+
+ @Test
+ public void testBasicDeleteFromDiagramActor() throws Exception {
+ deleteView(UMLElementTypes.ACTOR, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramBlock() throws Exception {
+ deleteView(SysMLElementTypes.BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramComment() throws Exception {
+ deleteView(UMLElementTypes.COMMENT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramConstraintBlock() throws Exception {
+ deleteView(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramConstraint() throws Exception {
+ deleteView(UMLElementTypes.CONSTRAINT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramConstraintProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramDataType() throws Exception {
+ deleteView(UMLElementTypes.DATA_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramDimension() throws Exception {
+ deleteView(SysMLElementTypes.DIMENSION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramEnumeration() throws Exception {
+ deleteView(UMLElementTypes.ENUMERATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramEnumerationLiteral() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.ENUMERATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_ENUMERATIONLITERAL_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.ENUMERATION_LITERAL, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramFlowPort() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.FLOW_PORT, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramFlowProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.FLOW_PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramFlowSpecification() throws Exception {
+ deleteView(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramInstanceSpecification() throws Exception {
+ deleteView(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramInterface() throws Exception {
+ deleteView(UMLElementTypes.INTERFACE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramModel() throws Exception {
+ deleteView(UMLElementTypes.MODEL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramOperation() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.OPERATION, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramPackage() throws Exception {
+ deleteView(UMLElementTypes.PACKAGE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramPart() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.PART_PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramPort() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.PORT, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramPrimitiveType() throws Exception {
+ deleteView(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.INTERFACE, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramReception() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ View droppedElement = dropFromModelExplorer(UMLElementTypes.RECEPTION, compartment);
+ deleteView(droppedElement, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramReference() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.REFERENCE_PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramSignal() throws Exception {
+ deleteView(UMLElementTypes.SIGNAL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramSlot() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, ElementTypes.INSTANCE_SPECIFICATION_COMPARTMENT_SLOT_HINT);
+ View testedView = dropFromModelExplorer(UMLElementTypes.SLOT, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramUnit() throws Exception {
+ deleteView(SysMLElementTypes.UNIT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramValue() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.VALUE_PROPERTY, compartment);
+ deleteView(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromDiagramValueType() throws Exception {
+ deleteView(SysMLElementTypes.VALUE_TYPE, getDiagramView(), true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromModel.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromModel.java
new file mode 100644
index 00000000000..3771a5d705a
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/delete/TestNodeBasicDeleteFromModel.java
@@ -0,0 +1,202 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.delete;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.dropFromModelExplorer;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.deleteElement;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+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;
+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.Test;
+
+/**
+ * JUnit tests for element Delete test (via palette tools) in diagram.
+ */
+public class TestNodeBasicDeleteFromModel extends AbstractTest {
+
+ @Test
+ public void testBasicDeleteFromModelActor() throws Exception {
+ deleteElement(UMLElementTypes.ACTOR, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelBlock() throws Exception {
+ deleteElement(SysMLElementTypes.BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelComment() throws Exception {
+ deleteElement(UMLElementTypes.COMMENT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelConstraintBlock() throws Exception {
+ deleteElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelConstraint() throws Exception {
+ deleteElement(UMLElementTypes.CONSTRAINT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelConstraintProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelDataType() throws Exception {
+ deleteElement(UMLElementTypes.DATA_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelDimension() throws Exception {
+ deleteElement(SysMLElementTypes.DIMENSION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelEnumeration() throws Exception {
+ deleteElement(UMLElementTypes.ENUMERATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelEnumerationLiteral() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.ENUMERATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_ENUMERATIONLITERAL_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.ENUMERATION_LITERAL, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelFlowPort() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.FLOW_PORT, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelFlowProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.FLOW_PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelFlowSpecification() throws Exception {
+ deleteElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelInstanceSpecification() throws Exception {
+ deleteElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelInterface() throws Exception {
+ deleteElement(UMLElementTypes.INTERFACE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelModel() throws Exception {
+ deleteElement(UMLElementTypes.MODEL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelOperation() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.OPERATION, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelPackage() throws Exception {
+ deleteElement(UMLElementTypes.PACKAGE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelPart() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.PART_PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelPort() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.PORT, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelPrimitiveType() throws Exception {
+ deleteElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelProperty() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.INTERFACE, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(UMLElementTypes.PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelReception() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ View droppedElement = dropFromModelExplorer(UMLElementTypes.RECEPTION, compartment);
+ deleteElement(droppedElement, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelReference() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.REFERENCE_PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelSignal() throws Exception {
+ deleteElement(UMLElementTypes.SIGNAL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelSlot() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, ElementTypes.INSTANCE_SPECIFICATION_COMPARTMENT_SLOT_HINT);
+ View testedView = dropFromModelExplorer(UMLElementTypes.SLOT, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelUnit() throws Exception {
+ deleteElement(SysMLElementTypes.UNIT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelValue() throws Exception {
+ View intermediateContainer = dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView());
+ View compartment = ViewUtil.getChildBySemanticHint(intermediateContainer, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ View testedView = dropFromModelExplorer(SysMLElementTypes.VALUE_PROPERTY, compartment);
+ deleteElement(testedView, true);
+ }
+
+ @Test
+ public void testBasicDeleteFromModelValueType() throws Exception {
+ deleteElement(SysMLElementTypes.VALUE_TYPE, getDiagramView(), true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/TestNodeDropOnDiagram.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/TestNodeDropOnDiagram.java
new file mode 100644
index 00000000000..29423053d8e
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/TestNodeDropOnDiagram.java
@@ -0,0 +1,186 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) in diagram.
+ */
+public class TestNodeDropOnDiagram extends AbstractTest {
+
+ @Test
+ public void testDropActorInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.ACTOR, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropBlockInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropCommentInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropConstraintBlockInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropConstraintInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropConstraintPropertyInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropDataTypeInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.DATA_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropDimensionInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.DIMENSION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropEnumerationInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.ENUMERATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropEnumerationLiteralInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropFlowPortInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropFlowPropertyInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropFlowSpecificationInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropInstanceSpecificationInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropInterfaceInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.INTERFACE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropModelInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.MODEL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropOperationInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropPackageInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PACKAGE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropPartInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropPortInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropPrimitiveTypeInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropPropertyInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropReceptionInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropReferenceInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropSignalInDiagram() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.SIGNAL, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropSlotInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropUnitInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.UNIT, getDiagramView(), true);
+ }
+
+ @Test
+ public void testDropValueInDiagram() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, getDiagramView(), false);
+ }
+
+ @Test
+ public void testDropValueTypeInDiagram() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.VALUE_TYPE, getDiagramView(), true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActor.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActor.java
new file mode 100644
index 00000000000..80cec2d491c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActor.java
@@ -0,0 +1,231 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Actor.
+ */
+public class TestNodeDropOnActor extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.ACTOR, UMLGraphicalTypes.SHAPE_UML_ACTOR_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorOperationCompartment.java
new file mode 100644
index 00000000000..034b7f3429a
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorOperationCompartment.java
@@ -0,0 +1,17 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element drop test (via palette tools) in an Actor "operations" compartment.
+ */
+public class TestNodeDropOnActorOperationCompartment extends AbstractTest {
+
+ @Ignore("Actor should not have operations compartment.")
+ @Test
+ public void warning() {
+ };
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorPropertyCompartment.java
new file mode 100644
index 00000000000..e8331114579
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnActorPropertyCompartment.java
@@ -0,0 +1,17 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element drop test (via palette tools) in an Actor "properties" compartment.
+ */
+public class TestNodeDropOnActorPropertyCompartment extends AbstractTest {
+
+ @Ignore("Actor should not have properties compartment.")
+ @Test
+ public void warning() {
+ };
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlock.java
new file mode 100644
index 00000000000..c2542eee3f5
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlock.java
@@ -0,0 +1,276 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlock extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.FLOW_PORT, containerView, true);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.OPERATION, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.PART_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PORT, containerView, true);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.RECEPTION, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.REFERENCE_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.VALUE_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockConstraintCompartment.java
new file mode 100644
index 00000000000..ba6e4ee1e34
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockConstraintCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockConstraintCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockFlowPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockFlowPortCompartment.java
new file mode 100644
index 00000000000..e46a8b6c6fc
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockFlowPortCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockFlowPortCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPORT_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockOperationCompartment.java
new file mode 100644
index 00000000000..ec7f51cb944
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockOperationCompartment.java
@@ -0,0 +1,297 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPartCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPartCompartment.java
new file mode 100644
index 00000000000..7d338506df2
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPartCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockPartCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PART_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPortCompartment.java
new file mode 100644
index 00000000000..f9beaef9fff
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPortCompartment.java
@@ -0,0 +1,297 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockPortCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_PORT_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPropertyCompartment.java
new file mode 100644
index 00000000000..412f74bab73
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockPropertyCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockPropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockReferenceCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockReferenceCompartment.java
new file mode 100644
index 00000000000..32f07241c3c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockReferenceCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockReferenceCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_REFERENCE_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockValueCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockValueCompartment.java
new file mode 100644
index 00000000000..f7b63d4264c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnBlockValueCompartment.java
@@ -0,0 +1,296 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Block.
+ */
+public class TestNodeDropOnBlockValueCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_VALUE_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPortContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPartContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPortContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PORT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReceptionContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReferenceContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlock.java
new file mode 100644
index 00000000000..56b9ef48e2e
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlock.java
@@ -0,0 +1,241 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on ConstraintBlock.
+ */
+public class TestNodeDropOnConstraintBlock extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.CONSTRAINT_BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockConstraintCompartment.java
new file mode 100644
index 00000000000..e547418958d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockConstraintCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on ConstraintBlock.
+ */
+public class TestNodeDropOnConstraintBlockConstraintCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.CONSTRAINT_BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception { // Parameter
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockParameterCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockParameterCompartment.java
new file mode 100644
index 00000000000..e891c8fa782
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnConstraintBlockParameterCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on ConstraintBlock.
+ */
+public class TestNodeDropOnConstraintBlockParameterCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.CONSTRAINT_BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PARAMETER_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception { // Parameter
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataType.java
new file mode 100644
index 00000000000..2cc6fb9f4f8
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataType.java
@@ -0,0 +1,241 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnDataType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.DATA_TYPE, UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.OPERATION, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypeOperationCompartment.java
new file mode 100644
index 00000000000..1863e1d49ac
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypeOperationCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnDataTypeOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.DATA_TYPE, UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypePropertyCompartment.java
new file mode 100644
index 00000000000..15845e58c77
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDataTypePropertyCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Signal.
+ */
+public class TestNodeDropOnDataTypePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.DATA_TYPE, UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDimension.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDimension.java
new file mode 100644
index 00000000000..eb0dcfc2417
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnDimension.java
@@ -0,0 +1,226 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnDimension extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.DIMENSION, SysMLGraphicalTypes.SHAPE_SYSML_DIMENSION_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumeration.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumeration.java
new file mode 100644
index 00000000000..22b734b3bf0
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumeration.java
@@ -0,0 +1,246 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnEnumeration extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.ENUMERATION, UMLGraphicalTypes.SHAPE_UML_ENUMERATION_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteralContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.ENUMERATION_LITERAL, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.OPERATION, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumerationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumerationCompartment.java
new file mode 100644
index 00000000000..7b5c7478de1
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnEnumerationCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Enumeration compartment.
+ */
+public class TestNodeDropOnEnumerationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.ENUMERATION, UMLGraphicalTypes.SHAPE_UML_ENUMERATION_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_ENUMERATIONLITERAL_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteralContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecification.java
new file mode 100644
index 00000000000..59df29409af
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecification.java
@@ -0,0 +1,236 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on FlowSpecification.
+ */
+public class TestNodeDropOnFlowSpecification extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.FLOW_SPECIFICATION, SysMLGraphicalTypes.SHAPE_SYSML_FLOWSPECIFICATION_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPropertyContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.FLOW_PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecificationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecificationCompartment.java
new file mode 100644
index 00000000000..3d760d3beb9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnFlowSpecificationCompartment.java
@@ -0,0 +1,248 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on FlowSpecification compartment.
+ */
+public class TestNodeDropOnFlowSpecificationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.FLOW_SPECIFICATION, SysMLGraphicalTypes.SHAPE_SYSML_FLOWSPECIFICATION_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPropertyContained() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterface.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterface.java
new file mode 100644
index 00000000000..40ba19f2dfe
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterface.java
@@ -0,0 +1,241 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Interface.
+ */
+public class TestNodeDropOnInterface extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INTERFACE, UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.OPERATION, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfaceOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfaceOperationCompartment.java
new file mode 100644
index 00000000000..5c9ff281017
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfaceOperationCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Interface.
+ */
+public class TestNodeDropOnInterfaceOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INTERFACE, UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfacePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfacePropertyCompartment.java
new file mode 100644
index 00000000000..6195eafa240
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnInterfacePropertyCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Interface.
+ */
+public class TestNodeDropOnInterfacePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INTERFACE, UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnPrimitiveType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnPrimitiveType.java
new file mode 100644
index 00000000000..3052c928312
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnPrimitiveType.java
@@ -0,0 +1,231 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on PrimitiveType.
+ */
+public class TestNodeDropOnPrimitiveType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.PRIMITIVE_TYPE, UMLGraphicalTypes.SHAPE_UML_PRIMITIVETYPE_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignal.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignal.java
new file mode 100644
index 00000000000..0d655df4746
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignal.java
@@ -0,0 +1,236 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Signal.
+ */
+public class TestNodeDropOnSignal extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.SIGNAL, UMLGraphicalTypes.SHAPE_UML_SIGNAL_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalOperationCompartment.java
new file mode 100644
index 00000000000..f0f12f440ad
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalOperationCompartment.java
@@ -0,0 +1,16 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Signal.
+ */
+public class TestNodeDropOnSignalOperationCompartment extends AbstractTest {
+
+ @Ignore("Signal should not have operations compartment.")
+ @Test
+ public void warning() {
+ };
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalPropertyCompartment.java
new file mode 100644
index 00000000000..076854d57c2
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnSignalPropertyCompartment.java
@@ -0,0 +1,254 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnSignalPropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.DATA_TYPE, UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnUnit.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnUnit.java
new file mode 100644
index 00000000000..b653878db71
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnUnit.java
@@ -0,0 +1,226 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Unit.
+ */
+public class TestNodeDropOnUnit extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.UNIT, SysMLGraphicalTypes.SHAPE_SYSML_UNIT_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueType.java
new file mode 100644
index 00000000000..20c1cd65452
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueType.java
@@ -0,0 +1,241 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on ValueType.
+ */
+public class TestNodeDropOnValueType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.VALUE_TYPE, SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID, getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.OPERATION, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.PROPERTY, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypeOperationCompartment.java
new file mode 100644
index 00000000000..78f61376c20
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypeOperationCompartment.java
@@ -0,0 +1,255 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on DataType.
+ */
+public class TestNodeDropOnValueTypeOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.VALUE_TYPE, SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypePropertyCompartment.java
new file mode 100644
index 00000000000..3cccf6312a9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/custom/TestNodeDropOnValueTypePropertyCompartment.java
@@ -0,0 +1,255 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+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.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on ValueType.
+ */
+public class TestNodeDropOnValueTypePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(SysMLElementTypes.VALUE_TYPE, SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID, getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperationContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPropertyContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnComment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnComment.java
new file mode 100644
index 00000000000..d2e3cebf11d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnComment.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Comment.
+ */
+public class TestNodeDropOnComment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnCommentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnCommentCN.java
new file mode 100644
index 00000000000..ab62c0ff652
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnCommentCN.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Comment Child node.
+ */
+public class TestNodeDropOnCommentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.COMMENT, ElementTypes.COMMENT_CN.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java
new file mode 100644
index 00000000000..bd8368113f2
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraint.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Constraint.
+ */
+public class TestNodeDropOnConstraint extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java
new file mode 100644
index 00000000000..48269724670
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnConstraintCN.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Constraint Child node.
+ */
+public class TestNodeDropOnConstraintCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.CONSTRAINT, ElementTypes.CONSTRAINT_CN.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecification.java
new file mode 100644
index 00000000000..886c3090653
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecification.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on InstanceSpecification.
+ */
+public class TestNodeDropOnInstanceSpecification extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCN.java
new file mode 100644
index 00000000000..293d6efee35
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCN.java
@@ -0,0 +1,221 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on InstanceSpecification Child node.
+ */
+public class TestNodeDropOnInstanceSpecificationCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION_CN.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartment.java
new file mode 100644
index 00000000000..f95e72fdd9c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartment.java
@@ -0,0 +1,229 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on InstanceSpecification Compartment.
+ */
+public class TestNodeDropOnInstanceSpecificationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint(), getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, ElementTypes.INSTANCE_SPECIFICATION_COMPARTMENT_SLOT_HINT);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlotContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartmentCN.java
new file mode 100644
index 00000000000..f34e4d5e97a
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnInstanceSpecificationCompartmentCN.java
@@ -0,0 +1,229 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on InstanceSpecification Compartment.
+ */
+public class TestNodeDropOnInstanceSpecificationCompartmentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ View elementView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.INSTANCE_SPECIFICATION, ElementTypes.INSTANCE_SPECIFICATION_CN.getSemanticHint(), getDiagramView());
+ containerView = ViewUtil.getChildBySemanticHint(elementView, ElementTypes.INSTANCE_SPECIFICATION_CN_COMPARTMENT_SLOT_HINT);
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDimension() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.DIMENSION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumeration() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropEnumerationLiteral() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.ENUMERATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.ENUMERATION_LITERAL, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropFlowSpecification() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.FLOW_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInstanceSpecification() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropInterface() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.INTERFACE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropModel() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.MODEL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropOperation() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.OPERATION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPackage() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PACKAGE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPart() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.PART_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPort() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PORT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropPrimitiveType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.PRIMITIVE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReception() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.RECEPTION, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropReference() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.REFERENCE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSignal() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SIGNAL, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlot() throws Exception {
+ EObject intermediateContainer = createElement(UMLElementTypes.INSTANCE_SPECIFICATION, getDiagramView());
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropSlotContained() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.SLOT, ViewUtil.getContainerView(containerView));
+ dropFromModelExplorer(droppedElement, containerView, true);
+ }
+
+ @Test
+ public void testDropUnit() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.UNIT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValue() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropValueType() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.VALUE_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModel.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModel.java
new file mode 100644
index 00000000000..e55398a30ee
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/dnd/inherited/TestNodeDropOnModel.java
@@ -0,0 +1,306 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.dnd.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils.createElement;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestUtils.dropFromModelExplorer;
+
+import org.eclipse.emf.ecore.EObject;
+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;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.TestPrepareUtils;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element Drop test (via palette tools) on Model.
+ */
+public class TestNodeDropOnModel extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ containerView = TestPrepareUtils.createGraphicalNode(UMLElementTypes.MODEL, ElementTypes.MODEL.getSemanticHint(), getDiagramView());
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.", e);
+ }
+ }
+
+ @Test
+ public void testDropActor() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.ACTOR, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropActorContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.ACTOR, containerView, false);
+ }
+
+ @Test
+ public void testDropBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropBlockContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.BLOCK, containerView, false);
+ }
+
+ @Test
+ public void testDropComment() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.COMMENT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropCommentContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.COMMENT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlock() throws Exception {
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintBlockContained() throws Exception {
+ dropFromModelExplorer(SysMLElementTypes.CONSTRAINT_BLOCK, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraint() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.CONSTRAINT, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintContained() throws Exception {
+ dropFromModelExplorer(UMLElementTypes.CONSTRAINT, containerView, false);
+ }
+
+ @Test
+ public void testDropConstraintProperty() throws Exception {
+ EObject intermediateContainer = createElement(SysMLElementTypes.CONSTRAINT_BLOCK, getDiagramView());
+ EObject droppedElement = createElement(SysMLElementTypes.CONSTRAINT_PROPERTY, intermediateContainer);
+ dropFromModelExplorer(droppedElement, containerView, false);
+ }
+
+ @Test
+ public void testDropDataType() throws Exception {
+ EObject droppedElement = createElement(UMLElementTypes.DATA_TYPE, getDiagramView());
+ dropFromModelExplorer(droppedElement, containerView, false);