Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2017-06-02 12:46:13 +0000
committerPatrick Tessier2017-06-02 13:16:27 +0000
commitf2d7692a04c675b03dc2fe131a18d1aa6d1f8c4e (patch)
tree1b309cc58a4cdc029524a12dad0b85e254b440be
parent2396ac00dbb3f77d56a484feac20f2ca022ad695 (diff)
downloadorg.eclipse.papyrus-f2d7692a04c675b03dc2fe131a18d1aa6d1f8c4e.tar.gz
org.eclipse.papyrus-f2d7692a04c675b03dc2fe131a18d1aa6d1f8c4e.tar.xz
org.eclipse.papyrus-f2d7692a04c675b03dc2fe131a18d1aa6d1f8c4e.zip
Bug 517702 - [Tests] [Oxygen] Tiemout problems duting sequence and
interactionoverview diagrams tests Change-Id: I65af0652ec7be9caa35188b022b91c0d9d61faf7
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java57
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/m7/TestMessageOccurrenceSpecification_402975.java8
2 files changed, 33 insertions, 32 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
index b492a2ae4d3..94374cc18c2 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
@@ -215,39 +215,40 @@ public class MessageHelperAdvice extends AbstractEditHelperAdvice {
toReplacebyMessageSent.getExecution().setFinish((OccurrenceSpecification)message.getSendEvent());
}
}
- //the occurennce spec must disapear!
- if(toReplacebyMessageReceive.getOwner()!=null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageSent);
- if(provider != null) {
- DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageSent, false);
- ICommand destroyCommand = provider.getEditCommand(destroyRequest);
- destroyCommand.execute(new NullProgressMonitor(), null);
+ if(toReplacebyMessageReceive!=null) {
+ //the occurennce spec must disapear!
+ if(toReplacebyMessageReceive.getOwner()!=null) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageSent);
+ if(provider != null) {
+ DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageSent, false);
+ ICommand destroyCommand = provider.getEditCommand(destroyRequest);
+ destroyCommand.execute(new NullProgressMonitor(), null);
+ }
}
- }
- }
- if(toReplacebyMessageReceive!=null) {
- //replace by the receive message
- if(toReplacebyMessageReceive.getExecution()!=null) {
- //this is the start?
- if( toReplacebyMessageReceive.getExecution().getStart().equals(toReplacebyMessageReceive)) {
- toReplacebyMessageReceive.getExecution().setStart((OccurrenceSpecification)message.getReceiveEvent());
- }
- else {
- //this is the finish
- toReplacebyMessageReceive.getExecution().setFinish((OccurrenceSpecification)message.getReceiveEvent());
+
+
+ //replace by the receive message
+ if(toReplacebyMessageReceive.getExecution()!=null) {
+ //this is the start?
+ if( toReplacebyMessageReceive.getExecution().getStart().equals(toReplacebyMessageReceive)) {
+ toReplacebyMessageReceive.getExecution().setStart((OccurrenceSpecification)message.getReceiveEvent());
+ }
+ else {
+ //this is the finish
+ toReplacebyMessageReceive.getExecution().setFinish((OccurrenceSpecification)message.getReceiveEvent());
+ }
}
- }
- //the occurence spec must be deleted
- if(toReplacebyMessageReceive.getOwner()!=null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageReceive);
- if(provider != null) {
- DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageReceive, false);
- ICommand destroyCommand = provider.getEditCommand(destroyRequest);
- destroyCommand.execute(new NullProgressMonitor(), null);
+ //the occurence spec must be deleted
+ if(toReplacebyMessageReceive.getOwner()!=null) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toReplacebyMessageReceive);
+ if(provider != null) {
+ DestroyElementRequest destroyRequest = new DestroyElementRequest(toReplacebyMessageReceive, false);
+ ICommand destroyCommand = provider.getEditCommand(destroyRequest);
+ destroyCommand.execute(new NullProgressMonitor(), null);
+ }
}
}
}
-
return CommandResult.newOKCommandResult(message);
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/m7/TestMessageOccurrenceSpecification_402975.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/m7/TestMessageOccurrenceSpecification_402975.java
index 4610dcf5153..57421dc412d 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/m7/TestMessageOccurrenceSpecification_402975.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/m7/TestMessageOccurrenceSpecification_402975.java
@@ -60,7 +60,7 @@ public class TestMessageOccurrenceSpecification_402975 extends AbstractNodeTest
protected AbstractExecutionSpecificationEditPart createExecutionSpecificationWithLifeline(Point lifelineLocation, Dimension lifelineSize) {
LifelineEditPart lifeline = (LifelineEditPart)createNode(UMLElementTypes.Lifeline_Shape, getRootEditPart(), lifelineLocation, lifelineSize);
assertNotNull("create ExecutionSpecification's Lifeline", lifeline);
- AbstractExecutionSpecificationEditPart es = (AbstractExecutionSpecificationEditPart)createNode(UMLElementTypes.ActionExecutionSpecification_Shape, lifeline, getAbsoluteBounds(lifeline).getCenter(), null);
+ AbstractExecutionSpecificationEditPart es = (AbstractExecutionSpecificationEditPart)createNode(UMLElementTypes.ActionExecutionSpecification_Shape, lifeline, new Point(0,50), new Dimension(20,50));
assertNotNull("create ExecutionSpecification", es);
return es;
}
@@ -115,8 +115,8 @@ public class TestMessageOccurrenceSpecification_402975 extends AbstractNodeTest
@Test
public void testReconnectSyncMessage() {
- AbstractExecutionSpecificationEditPart part1 = createExecutionSpecificationWithLifeline(new Point(50, 100), null);
- AbstractExecutionSpecificationEditPart part2 = createExecutionSpecificationWithLifeline(new Point(200, 100), null);
+ AbstractExecutionSpecificationEditPart part1 = createExecutionSpecificationWithLifeline(new Point(50, 100), new Dimension(100,1000));
+ AbstractExecutionSpecificationEditPart part2 = createExecutionSpecificationWithLifeline(new Point(200, 100),new Dimension(100,1000));
Point startLocation = getAbsoluteBounds(part1).getCenter();
Point endLocation = getAbsoluteCenter(part2).setY(startLocation.y + 1);
ExecutionSpecification execution2 = (ExecutionSpecification)part2.resolveSemanticElement();
@@ -127,7 +127,7 @@ public class TestMessageOccurrenceSpecification_402975 extends AbstractNodeTest
Message message = (Message)messagePart.resolveSemanticElement();
assertNotNull("message", message);
doCheckExecution(execution2, message, true);
- AbstractExecutionSpecificationEditPart part3 = (AbstractExecutionSpecificationEditPart)createNode(UMLElementTypes.ActionExecutionSpecification_Shape, part2.getParent(), getAbsoluteBounds(part2).getLocation().getTranslated(0, 100), null);
+ AbstractExecutionSpecificationEditPart part3 = (AbstractExecutionSpecificationEditPart)createNode(UMLElementTypes.ActionExecutionSpecification_Shape, part2.getParent(), new Point(0,300), null);
ExecutionSpecification execution3 = (ExecutionSpecification)part3.resolveSemanticElement();
assertNotNull("execution3", execution3);
//reconnect from execution2 to execution3.

Back to the top