Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2013-07-04 05:54:46 -0400
committerrschnekenbu2013-07-04 05:54:46 -0400
commitb8af47d4608196a42597ba13be8bd0fba368639f (patch)
tree688087e0771aed7cf00876dcc76e6564412f32eb /tests/junit/plugins
parent11674a8ab31b21752e071ea1023e9f941e3a468c (diff)
downloadorg.eclipse.papyrus-b8af47d4608196a42597ba13be8bd0fba368639f.tar.gz
org.eclipse.papyrus-b8af47d4608196a42597ba13be8bd0fba368639f.tar.xz
org.eclipse.papyrus-b8af47d4608196a42597ba13be8bd0fba368639f.zip
412218: [Refactoring Tests] The Deployment diagram tests should be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412218
Diffstat (limited to 'tests/junit/plugins')
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java5
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/IDeploymentDiagramTestsConstants.java22
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestCommentLink.java269
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestConstraintLink.java269
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramChildNode.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramCommentLink.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramConstraintLink.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramDeploymentLink.java13
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLink.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLinkOwnedBySource.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramManifestationLink.java13
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramTopNode.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestManifestationLink.java243
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestWithoutReconnectAMultilinkk.java (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentLink.java)3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load1000NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load100NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load10NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load200NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load300NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load400NodeTest.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load500NodeTest.java11
22 files changed, 196 insertions, 788 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
index 87f89fd2d9c..564c0397143 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="0.10.0",
org.eclipse.papyrus.uml.modelexplorer.tests;bundle-version="0.10.0",
org.eclipse.papyrus.uml.diagram.activity.tests;bundle-version="0.10.0",
+ org.eclipse.papyrus.uml.diagram.deployment.tests;bundle-version="0.10.0",
org.eclipse.papyrus.uml.diagram.pkg.tests;bundle-version="0.10.0",
org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="0.10.0",
org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="0.10.0",
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
index 3259b495e33..8ed18fc2ea7 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
@@ -80,13 +80,14 @@ public class AllTests {
/* uml idagrams */
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.diagram.clazz.test.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.activity.tests.AllTests.class));
- suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.usecase.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.pkg.tests.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.deployment.test.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.usecase.tests.AllTests.class));
//---- deactivate during test refactoring
//suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.timing.tests.AllTests.class));
//suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.component.test.AllTests.class));
- //suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.deployment.test.AllTests.class));
+ //
// ---- end deactivate
// suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.sequence.tests.AllTests.class));
// suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.interactionoverview.tests.AllTests.class)); //Disabled. They currently do not run on Hudson
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/IDeploymentDiagramTestsConstants.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/IDeploymentDiagramTestsConstants.java
new file mode 100644
index 00000000000..85b5bc47884
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/IDeploymentDiagramTestsConstants.java
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.deployment.test;
+
+public interface IDeploymentDiagramTestsConstants {
+
+ /** name of the test project */
+ public final String PROJECT_NAME = "DeploymentDiagramTestProject";
+
+ /** name of the test model */
+ public final String FILE_NAME = "DeploymentDiagramTest.di";
+} \ No newline at end of file
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestCommentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestCommentLink.java
deleted file mode 100644
index 1c90181df0a..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestCommentLink.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
-import org.eclipse.uml2.uml.Element;
-
-public abstract class TestCommentLink extends TestLink {
-
- /**
- * Test view deletion.
- *
- * @param type
- * the type
- */
- @Override
- public void testViewDeletion(IElementType type) {
- //DELETION OF THE VIEW
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(VIEW_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
-
- }
-
- /**
- * Test destroy.
- *
- * @param type
- * the type
- */
- @Override
- public void testDestroy(IElementType type) {
-
- //DESTROY SEMANTIC+ VIEW
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
-
- Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(DESTROY_DELETION + COMMAND_NULL, command);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
-
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
- }
-
- /**
- * Test drop.
- *
- * @param type
- * the type
- */
- @Override
- public void testDrop(IElementType type) {
- //DROP
-
- //it is impossible to drop but you can recreat the link between this element
- assertTrue(DROP + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- assertTrue(DROP + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 0);
- }
-
- /**
- * Test to create a link.
- *
- * @param linkType
- * the type
- */
- @Override
- public void testToCreateALink(IElementType linkType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, target));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);//1
-
- }
-
- @Override
- public void installEnvironment(IElementType sourceType, IElementType targetType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 0);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
-
- //create the source
- CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 100));
- Command command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the source player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 100));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
- sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
- target = (GraphicalEditPart)getDiagramEditPart().getChildren().get(2);
- targetPlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(3);
-
- }
-
- @Override
- public void testTargetReconnectAMultiLink(IElementType type) {
-
- //target reconnection
- ReconnectRequest reconnectRequest = new ReconnectRequest();
- assertTrue(THE_LINK_RECONNECT_EXISTS, (ConnectionEditPart)target.getTargetConnections().get(0) != null);
- ConnectionEditPart binaryLink = (ConnectionEditPart)target.getTargetConnections().get(0);
- reconnectRequest.setConnectionEditPart(binaryLink);
- reconnectRequest.setTargetEditPart(targetPlayer);
- reconnectRequest.setType(RequestConstants.REQ_RECONNECT_TARGET);
-
- Command cmd = targetPlayer.getCommand(reconnectRequest);
-
- assertTrue(RECONNECTION_TARGET + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, cmd.canExecute() == true);
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
- // EditorUtils.getTransactionalEditingDomain().getCommandStack().execute(cmd);
- assertTrue(RECONNECTION_TARGET + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(RECONNECTION_TARGET + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET, binaryLink.getTarget().equals(targetPlayer));
-
- //undo
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET + TEST_THE_UNDO, binaryLink.getTarget().equals(target));
-
- //redo
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET + TEST_THE_REDO, binaryLink.getTarget().equals(targetPlayer));
-
- }
-
- @Override
- public void testSourceReconnectAMultiLink(IElementType type) {
-
- }
-
- /**
- * test the drop of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToDropAlinkOnTheSame(IElementType linkType, boolean allowed) {
-
- }
-
- /**
- * test the creation of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToCreateAlinkOnTheSame(IElementType linkType, boolean allowed) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, source));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == allowed);
- if(allowed) {
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- }
-
- }
-}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestConstraintLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestConstraintLink.java
deleted file mode 100644
index a7db247c99c..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestConstraintLink.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
-import org.eclipse.uml2.uml.Element;
-
-public abstract class TestConstraintLink extends TestLink {
-
- /**
- * Test view deletion.
- *
- * @param type
- * the type
- */
- @Override
- public void testViewDeletion(IElementType type) {
- //DELETION OF THE VIEW
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(VIEW_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- }
-
- /**
- * Test destroy.
- *
- * @param type
- * the type
- */
- @Override
- public void testDestroy(IElementType type) {
-
- //DESTROY SEMANTIC+ VIEW
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(DESTROY_DELETION + COMMAND_NULL, command);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- }
-
- /**
- * Test drop.
- *
- * @param type
- * the type
- */
- @Override
- public void testDrop(IElementType type) {
- //DROP
-
- //it is impossible to drop but you can recreat the link between this element
- assertTrue(DROP + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- assertTrue(DROP + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 0);
- }
-
- /**
- * Test to create a link.
- *
- * @param linkType
- * the type
- */
- @Override
- public void testToCreateALink(IElementType linkType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, target));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- }
-
- @Override
- public void installEnvironment(IElementType sourceType, IElementType targetType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 0);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
-
- //create the source
- CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 100));
- Command command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the source player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 100));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
- sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
- target = (GraphicalEditPart)getDiagramEditPart().getChildren().get(2);
- targetPlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(3);
-
- }
-
- @Override
- public void testTargetReconnectAMultiLink(IElementType type) {
-
- //target reconnection
- ReconnectRequest reconnectRequest = new ReconnectRequest();
- assertTrue(THE_LINK_RECONNECT_EXISTS, (ConnectionEditPart)target.getTargetConnections().get(0) != null);
- ConnectionEditPart binaryLink = (ConnectionEditPart)target.getTargetConnections().get(0);
- reconnectRequest.setConnectionEditPart(binaryLink);
- reconnectRequest.setTargetEditPart(targetPlayer);
- reconnectRequest.setType(RequestConstants.REQ_RECONNECT_TARGET);
-
- Command cmd = targetPlayer.getCommand(reconnectRequest);
-
- assertTrue(RECONNECTION_TARGET + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, cmd.canExecute() == true);
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
- // EditorUtils.getTransactionalEditingDomain().getCommandStack().execute(cmd);
- assertTrue(RECONNECTION_TARGET + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(RECONNECTION_TARGET + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET, binaryLink.getTarget().equals(targetPlayer));
-
- //undo
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET + TEST_THE_UNDO, binaryLink.getTarget().equals(target));
-
- //redo
- getDiagramEditPart().getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(LINK_EXISTS_RECONNECTION_ON_TARGET + TEST_THE_REDO, binaryLink.getTarget().equals(targetPlayer));
-
- }
-
- @Override
- public void testSourceReconnectAMultiLink(IElementType type) {
-
- }
-
- /**
- * test the drop of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToDropAlinkOnTheSame(IElementType linkType, boolean allowed) {
-
- }
-
- /**
- * test the creation of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToCreateAlinkOnTheSame(IElementType linkType, boolean allowed) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, source));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == allowed);
- if(allowed) {
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- }
-
- }
-}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramChildNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramChildNode.java
index f3f647e8473..6d34e4b6916 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramChildNode.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramChildNode.java
@@ -19,6 +19,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestChildNode;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Test;
@@ -38,6 +39,16 @@ public class TestDeploymentDiagramChildNode extends TestChildNode {
return CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Package_2009, getDiagramEditPart().getDiagramPreferencesHint());
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage i package.
*/
@@ -101,5 +112,4 @@ public class TestDeploymentDiagramChildNode extends TestChildNode {
public void testToManageConstraint() {
testToManageNode(UMLElementTypes.Constraint_56, UMLPackage.eINSTANCE.getConstraint(), UMLElementTypes.Package_36, true);
}
-
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramCommentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramCommentLink.java
index 62f98ad67bf..80ddb004157 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramCommentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramCommentLink.java
@@ -13,8 +13,10 @@
package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.diagram.tests.canonical.TestCommentLink;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
public class TestDeploymentDiagramCommentLink extends TestCommentLink {
@@ -24,6 +26,16 @@ public class TestDeploymentDiagramCommentLink extends TestCommentLink {
return new CreateDeploymentDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Comment
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramConstraintLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramConstraintLink.java
index d91471e0d51..4eb25992674 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramConstraintLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramConstraintLink.java
@@ -13,8 +13,10 @@
package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.diagram.tests.canonical.TestConstraintLink;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
public class TestDeploymentDiagramConstraintLink extends TestConstraintLink {
@@ -24,6 +26,16 @@ public class TestDeploymentDiagramConstraintLink extends TestConstraintLink {
return new CreateDeploymentDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Constraint
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramDeploymentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramDeploymentLink.java
index ef7f2ecf4a0..c8ec2c01a2c 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramDeploymentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramDeploymentLink.java
@@ -15,18 +15,29 @@ package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
/**
* The Class TestComponentDiagramLink.
*/
-public class TestDeploymentDiagramDeploymentLink extends TestDeploymentLink {
+public class TestDeploymentDiagramDeploymentLink extends TestWithoutReconnectAMultilinkk {
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateDeploymentDiagramCommand();
}
+
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Deployment
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLink.java
index 377686c2dba..fb53b1a372c 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLink.java
@@ -16,6 +16,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
/**
@@ -28,6 +29,16 @@ public class TestDeploymentDiagramLink extends TestLink {
return new CreateDeploymentDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Dependency
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLinkOwnedBySource.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLinkOwnedBySource.java
index 6d21cb46345..1f515224640 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLinkOwnedBySource.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramLinkOwnedBySource.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestLinkOwnedBySource;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
/**
@@ -29,6 +30,16 @@ public class TestDeploymentDiagramLinkOwnedBySource extends TestLinkOwnedBySourc
return new CreateDeploymentDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Generalization
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramManifestationLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramManifestationLink.java
index 0ff8afb8548..906ae0b471b 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramManifestationLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramManifestationLink.java
@@ -15,18 +15,29 @@ package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.junit.Test;
/**
* The Class TestComponentDiagramLink.
*/
-public class TestDeploymentDiagramManifestationLink extends TestManifestationLink {
+public class TestDeploymentDiagramManifestationLink extends TestWithoutReconnectAMultilinkk {
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateDeploymentDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Manifestation
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramTopNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramTopNode.java
index f6562ad18ce..231e65ebe95 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramTopNode.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentDiagramTopNode.java
@@ -18,6 +18,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestTopNode;
import org.eclipse.papyrus.uml.diagram.deployment.CreateDeploymentDiagramCommand;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Test;
@@ -36,6 +37,16 @@ public class TestDeploymentDiagramTopNode extends TestTopNode {
return CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Package_2009, getDiagramEditPart().getDiagramPreferencesHint());
}
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage i package.
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestManifestationLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestManifestationLink.java
deleted file mode 100644
index 0b2b7fe3e5c..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestManifestationLink.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.deployment.test.canonical;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
-import org.eclipse.uml2.uml.Element;
-
-public abstract class TestManifestationLink extends TestLink {
-
- /**
- * Test view deletion.
- *
- * @param type
- * the type
- */
- @Override
- public void testViewDeletion(IElementType type) {
- //DELETION OF THE VIEW
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(VIEW_DELETION + COMMAND_NULL, command);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(VIEW_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(VIEW_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(VIEW_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- }
-
- /**
- * Test destroy.
- *
- * @param type
- * the type
- */
- @Override
- public void testDestroy(IElementType type) {
-
- //DESTROY SEMANTIC+ VIEW
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- Request deleteViewRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
- Command command = ((ConnectionEditPart)source.getSourceConnections().get(0)).getCommand(deleteViewRequest);
- assertNotNull(DESTROY_DELETION + COMMAND_NULL, command);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue(DESTROY_DELETION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
-
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, source.getSourceConnections().size() == 1);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, source.getSourceConnections().size() == 0);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DESTROY_DELETION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
- }
-
- /**
- * Test drop.
- *
- * @param type
- * the type
- */
- @Override
- public void testDrop(IElementType type) {
- //DROP
-
- //it is impossible to drop but you can recreat the link between this element
- assertTrue(DROP + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(DROP + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- assertTrue(DROP + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 0);
- }
-
- /**
- * Test to create a link.
- *
- * @param linkType
- * the type
- */
- @Override
- public void testToCreateALink(IElementType linkType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, target));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_EXECUTION, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_EXECUTION, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 0);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 1);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- assertTrue(CREATION + TEST_THE_REDO, ((Element)source.resolveSemanticElement()).getOwnedElements().size() == 1);
-
- }
-
- @Override
- public void installEnvironment(IElementType sourceType, IElementType targetType) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 0);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 0);
-
- //create the source
- CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 100));
- Command command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the source player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(sourceType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(100, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 100));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- //create the target player to test reconnect
- requestcreation = CreateViewRequestFactory.getCreateShapeRequest(targetType, getDiagramEditPart().getDiagramPreferencesHint());
- requestcreation.setLocation(new Point(300, 300));
- command = getDiagramEditPart().getCommand(requestcreation);
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CREATION + TEST_IF_THE_COMMAND_IS_CREATED, command != UnexecutableCommand.INSTANCE);
- assertTrue("CREATION: " + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == true);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
-
- source = (GraphicalEditPart)getDiagramEditPart().getChildren().get(0);
- sourcePlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(1);
- target = (GraphicalEditPart)getDiagramEditPart().getChildren().get(2);
- targetPlayer = (GraphicalEditPart)getDiagramEditPart().getChildren().get(3);
-
- }
-
- @Override
- public void testTargetReconnectAMultiLink(IElementType type) {
-
- }
-
- @Override
- public void testSourceReconnectAMultiLink(IElementType type) {
-
- }
-
- /**
- * test the drop of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToDropAlinkOnTheSame(IElementType linkType, boolean allowed) {
-
- }
-
- /**
- * test the creation of a link where the source and the target are the same objects
- *
- * @param linkType
- * @param allowed
- */
- @Override
- protected void testToCreateAlinkOnTheSame(IElementType linkType, boolean allowed) {
- assertTrue(CREATION + INITIALIZATION_TEST, getDiagramEditPart().getChildren().size() == 4);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
-
- Command command = target.getCommand(createConnectionViewRequest(linkType, source, source));
- assertNotNull(CREATION + COMMAND_NULL, command);
- assertTrue(CONTAINER_CREATION + TEST_IF_THE_COMMAND_CAN_BE_EXECUTED, command.canExecute() == allowed);
- if(allowed) {
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
- assertTrue(CREATION + INITIALIZATION_TEST, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + INITIALIZATION_TEST, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().undo();
- assertTrue(CREATION + TEST_THE_UNDO, getRootView().getChildren().size() == 4);
- assertTrue(CREATION + TEST_THE_UNDO, getRootSemanticModel().getOwnedElements().size() == 4);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().redo();
- assertTrue(CREATION + TEST_THE_REDO, ((Diagram)getRootView()).getEdges().size() == 2);
- assertTrue(CREATION + TEST_THE_REDO, getRootSemanticModel().getOwnedElements().size() == 4);
- }
-
- }
-}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestWithoutReconnectAMultilinkk.java
index 0ee7319858b..bbe332d9399 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestDeploymentLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/canonical/TestWithoutReconnectAMultilinkk.java
@@ -29,8 +29,7 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
import org.eclipse.uml2.uml.Element;
-public abstract class TestDeploymentLink extends TestLink {
-
+public abstract class TestWithoutReconnectAMultilinkk extends TestLink {
/**
* Test view deletion.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load1000NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load1000NodeTest.java
index c56388dff75..ff073fab518 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load1000NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load1000NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load1000NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load100NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load100NodeTest.java
index bdc17c9428c..d7b17e4ee2c 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load100NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load100NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load100NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load10NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load10NodeTest.java
index 99202735efd..47de67d9202 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load10NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load10NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load10NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load200NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load200NodeTest.java
index 1c53319527b..3886edbae9e 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load200NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load200NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load200NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load300NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load300NodeTest.java
index 49c0006244a..5dd05405845 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load300NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load300NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load300NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load400NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load400NodeTest.java
index f415b2634f2..8a6c617facf 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load400NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load400NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load400NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load500NodeTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load500NodeTest.java
index 82fad8e933f..3c9e6f605c3 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load500NodeTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/load/Load500NodeTest.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.deployment.test.IDeploymentDiagramTestsConstants;
import org.eclipse.papyrus.uml.diagram.deployment.test.canonical.AbstractPapyrusTestCase;
import org.junit.Test;
@@ -26,6 +27,16 @@ import org.junit.Test;
*/
public class Load500NodeTest extends AbstractPapyrusTestCase {
+ @Override
+ protected String getProjectName() {
+ return IDeploymentDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IDeploymentDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to create a node.
*

Back to the top