diff options
author | Vincent Lorenzo | 2016-05-26 12:16:59 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-05-26 12:19:47 +0000 |
commit | 0105d44d9bf86f61bdc2cd8e9c7163d3618596fc (patch) | |
tree | 88d12c48e5cfc761e64d725a6c5928c2c02631d4 | |
parent | 99ede97fe480c2395d8f9e5fa52f9fe5a347a7af (diff) | |
download | org.eclipse.papyrus-0105d44d9bf86f61bdc2cd8e9c7163d3618596fc.tar.gz org.eclipse.papyrus-0105d44d9bf86f61bdc2cd8e9c7163d3618596fc.tar.xz org.eclipse.papyrus-0105d44d9bf86f61bdc2cd8e9c7163d3618596fc.zip |
bug 492522: [All Diagrams] Delete from model on comment links does not work (does a delete from diagram) - Fix new Junit tests
3 files changed, 21 insertions, 10 deletions
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/resource/bug492522/model.uml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/resource/bug492522/model.uml index 0a2cf84ddc6..634d48c67c9 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/resource/bug492522/model.uml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/resource/bug492522/model.uml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_iQwqkBjXEeaAu8qnqsGe1A" name="RootElement">
<ownedComment xmi:type="uml:Comment" xmi:id="_A0dykBjaEeaV3KztP2zOoA" annotatedElement="_BPe6oBjaEeaV3KztP2zOoA _rgwRoBt8EeaV3KztP2zOoA _uV4EoBt8EeaV3KztP2zOoA">
- <body><p>This comment is displayed on ClassDiagram, Composite Diagram, Component Diagram, and annotates Class1, Class2 and the Constraint Constraint1. It is commented by the second Comment.</p>
+ <body><p>Comment1:This comment is displayed on ClassDiagram, Composite Diagram, Component Diagram, and annotates Class1, Class2 and the Constraint Constraint1. It is commented by the second Comment.</p>
</body>
</ownedComment>
<ownedComment xmi:type="uml:Comment" xmi:id="_zhSZkBt8EeaV3KztP2zOoA" annotatedElement="_A0dykBjaEeaV3KztP2zOoA">
- <body><p>This comment, comments the other comment.</p>
+ <body><p>Comment2:This comment, comments the other comment.</p>
</body>
</ownedComment>
<packagedElement xmi:type="uml:Class" xmi:id="_BPe6oBjaEeaV3KztP2zOoA" name="Class1">
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/deletion/DeleteCommentLinkTest.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/deletion/DeleteCommentLinkTest.java index 77a8c278126..e6dc1a0dc56 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/deletion/DeleteCommentLinkTest.java +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/deletion/DeleteCommentLinkTest.java @@ -82,9 +82,9 @@ public class DeleteCommentLinkTest extends AbstractPapyrusTest { @Rule public final PapyrusEditorFixture fixture = new PapyrusEditorFixture(); - private static final String COMMENT1_BODY = "This comment is displayed on ClassDiagram, Composite Diagram, Component Diagram and annotates Class1, Class2 and the Constraint Constraint1. It is commented by the second Comment."; //$NON-NLS-1$ + private static final String COMMENT1_BODY_START = "Comment1"; //$NON-NLS-1$ - private static final String COMMENT2_BODY = "This comment, comments the other comment."; //$NON-NLS-1$ + private static final String COMMENT2_BODY_START = "Comment2"; //$NON-NLS-1$ private static final int NB_EDGES_BEFORE_DELETION_IN_CLASS_DIAGRAM = 10; @@ -119,7 +119,7 @@ public class DeleteCommentLinkTest extends AbstractPapyrusTest { private static final String COMPOSITE_DIAGRAM_NAME = "CompositeDiagram"; //$NON-NLS-1$ - private static final String COMPONENT_DIAGRAM_NAME = "CompositeDiagram"; //$NON-NLS-1$ + private static final String COMPONENT_DIAGRAM_NAME = "ComponentDiagram"; //$NON-NLS-1$ private Diagram classDiagram; @@ -132,14 +132,14 @@ public class DeleteCommentLinkTest extends AbstractPapyrusTest { // get the elements of the model this.class1 = (Class) fixture.getModel().getOwnedMember("Class1"); //$NON-NLS-1$ this.class2 = (Class) fixture.getModel().getOwnedMember("Class2"); //$NON-NLS-1$ - this.constraint1 = (Constraint) class1.getMember("Constraint1"); //$NON-NLS-1$ + this.constraint1 = (Constraint) this.class1.getMember("Constraint1"); //$NON-NLS-1$ for (Comment current : fixture.getModel().getOwnedComments()) { - if (current.getBody().contains(COMMENT1_BODY)) { + if (current.getBody().contains(COMMENT1_BODY_START)) { this.comment1 = current; continue; } - if (current.getBody().contains(COMMENT2_BODY)) { + if (current.getBody().contains(COMMENT2_BODY_START)) { this.comment2 = current; continue; } @@ -159,11 +159,14 @@ public class DeleteCommentLinkTest extends AbstractPapyrusTest { classDiagram = (Diagram) current; } else if (COMPOSITE_DIAGRAM_NAME.equals(name)) { compositeDiagram = (Diagram) current; + } else if (COMPONENT_DIAGRAM_NAME.equals(name)) { + componentDiagram = (Diagram) current; } } } Assert.assertNotNull(classDiagram); Assert.assertNotNull(compositeDiagram); + Assert.assertNotNull(componentDiagram); } @@ -337,7 +340,15 @@ public class DeleteCommentLinkTest extends AbstractPapyrusTest { } - + /** + * + * @param diagram + * a diagram + * @param nbEdgeAfterDeletion + * the number of link displayed in the diagram after the deletion + * @param nbNodeInDiagram + * the number of node displayed in the diagram after the deletion + */ protected void checkDiagramAfterLinkDeletion(Diagram diagram, int nbEdgeAfterDeletion, int nbNodeInDiagram) { // Diagram diagram = fixture.getDiagram(classDiagram2).getDiagramView(); Assert.assertEquals(nbEdgeAfterDeletion, diagram.getEdges().size()); diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/suites/AllTests.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/suites/AllTests.java index 1694cf3064c..f99f18e11f1 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/suites/AllTests.java +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/src/org/eclipse/papyrus/uml/service/types/tests/suites/AllTests.java @@ -9,7 +9,7 @@ * Contributors: * CEA LIST - Initial API and implementation * Christian W. Damus - bugs 458685, 468071, 465899, 478314, 485220 - * + * Vincent Lorenzo - bug 492522 *****************************************************************************/ package org.eclipse.papyrus.uml.service.types.tests.suites; |