-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Executions initial implementation #394
Conversation
- new method to get elementAt on execution specification, and access to nested executions - command to create a nested execution, that may be refactored with some commons of the insertExecutionCommand on lifelines - Add some tests - handle destruction of nested executions (and their related messages / nested lifelines in chain) Some points left: - adding a nested execution always nudge parent exec, where it should not if there is enough space - no side is currently handled for the nested execution representation - getNestedExecution() may rely on recently introduced getCovered() for #52 Change-Id: I50589eb0e4ae7b850579d6e1cad5966937dffa4c Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
- Check and update model generation for test and model plugin from seqd.ecore - do not update edit plugin (formatting issues with current version on the server) Change-Id: I532032620ae40c29412ef113f183709a4cc25b5c Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
- update the nudging policy to be similar to the current implementation of standard executions - 2 issues in the tests: 1 is ignored (but not by my dev env) as the test is not implemented yet, and one that can be reproduced by hand: if a lifeline has an execution with a nested execution, it can not be deleted. Change-Id: I4b52b6d0a7248dcfe01365c40d559602d30406c5 Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
- update lifeline API with a method to get first level executions to be able to remove only these executions. Nested ones will be remove in chain by the remove execution command - update tests Change-Id: Iae629bd73730a75880ecdb4ff263aaefd7428ac7 Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
- Develop additional tests for complex scenarios (dependencies with messages between different lifelines) - 2 tests are failing, but this seems independant from the nested exec spec, as it fails even if they are removed from initial model. Change-Id: I56794a50383e3e4d793ffa62d49089188f2c8f2a Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
Conflicts: plugins/org.eclipse.papyrus.uml.interaction.model/model/seqd.ecore plugins/org.eclipse.papyrus.uml.interaction.model/model/seqd.genmodel plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/SequenceDiagramPackage.java plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/impl/MExecutionImpl.java plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/impl/MLifelineImpl.java plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/impl/SequenceDiagramPackageImpl.java plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/model/MExecution.java plugins/org.eclipse.papyrus.uml.interaction.model/src-gen/org/eclipse/papyrus/uml/interaction/model/MLifeline.java tests/org.eclipse.papyrus.uml.interaction.model.tests/src-gen/org/eclipse/papyrus/uml/interaction/model/tests/MExecutionTest.java tests/org.eclipse.papyrus.uml.interaction.model.tests/src-gen/org/eclipse/papyrus/uml/interaction/model/tests/MLifelineTest.java
- generate code from ecore model after merge - Add functional test for creation Change-Id: I08bd36736552dbe715c426107c7108a50cd20b20 Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, @rschnekenbu! I see only a few problems in the diagram behaviour:
- most severe is that when reorienting the request message that starts the top execution of a stack to be received by another lifeline, all of the nested executions are moved with it (this "just works" as I had expected :-)) but the nesting is lost. All of the executions end up piled directly on top of one another
- if I create a synchronous message with execution and reply in which the request is drawn from right to left and then add a nested execution, that execution is on the right side. I think it should be on the left
- if I draw a message from right to left out of an execution that is nested on the right side, the message is anchored to the right side of the nested execution, not the left
- drawing a synchronous message to an execution specification doesn't create a nested execution. The editor prompts for the kind of execution to create, but then it doesn't create an
execution nor does it create the reply message (obviously, because there's no execution). I expected to get a nested execution with reply
- I think it's already known, but I'll mention it here for completeness' sake, that when moving the lifeline that owns the executions so that messages incoming and outgoing those executions change orientation, they remain attached to the same side of the executions (except for the request/reply messages, which were fixed by improvements to the start/end anchors).
One new test fails on Mac (see the in-line comments) and there's a test that was deleted that should be restored (again, see the in-line comments).
Also, there are a lot of formatting changes in the EMF.Edit item providers. Is that expected? It looks like the code was formatted (with JDT's "clean up") after re-generating.
....sequence.figure/src/org/eclipse/papyrus/uml/diagram/sequence/figure/LifelineBodyFigure.java
Outdated
Show resolved
Hide resolved
...iagram/sequence/runtime/internal/edit/policies/ExecutionSpecificationCreationEditPolicy.java
Outdated
Show resolved
Hide resolved
...iagram/sequence/runtime/internal/edit/policies/ExecutionSpecificationCreationEditPolicy.java
Outdated
Show resolved
Hide resolved
...on.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/impl/MExecutionImpl.java
Show resolved
Hide resolved
...ion.model/src-gen/org/eclipse/papyrus/uml/interaction/internal/model/impl/MLifelineImpl.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/papyrus/uml/interaction/internal/model/commands/InsertNestedExecutionCommand.java
Outdated
Show resolved
Hide resolved
*/ | ||
@SuppressWarnings("restriction") | ||
@ModelResource("one-exec.di") | ||
public class ExecutionSpecificationCreationEditPolicyUITest extends AbstractGraphicalEditPolicyUITest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Unfortunately, this test fails on my Mac:
Expected: location point that x that 276 ± 1 and y that 170 ± 1
but: location y was <165>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at org.eclipse.papyrus.uml.diagram.sequence.runtime.internal.edit.policies.tests.ExecutionSpecificationCreationEditPolicyUITest.createNestedExecution(ExecutionSpecificationCreationEditPolicyUITest.java:64)
On the plus side, all of the other tests still pass (with no new skips). 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, interesting! Again an issue with different platforms. I updated the test so it does get the initial Y value and compare the value after execution with the initial one.
Funny fact is that this model is also used in other classes, like ExecutionSnappingUITest. In all other classes, it is not used directly, only with offset to set the message connection point, or not used at all ;)
I would still be very happy to understand this difference. The position of the execution is set on the lifeline body, at least in notation. The height of the header is set also, so as its y position. The interaction iself may have a different layout with its label on top, given the font? This is the only element that does not have a size pushed in notation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, on my system, the tests are green. So, that's good. However, there's now an assumption failure that skips the ExecutionMoveUITest::moveSyncMessageEnd
test. It seems that the sync message is no longer located in the diagram where the test expects it to be.
...ction.model.tests/src-gen/org/eclipse/papyrus/uml/interaction/model/tests/MLifelineTest.java
Outdated
Show resolved
Hide resolved
...l.tests/src/org/eclipse/papyrus/uml/interaction/model/tests/deletion/DeleteLifelineTest.java
Show resolved
Hide resolved
- avoid issue on nested executions when reparenting the parent execution on another lifeline using start message + add functional test - fix typo on Occur'r'ence variables - use Optionals#as in ExecutionSpecificationCreationEditPolicy - improve code readability in MLifelineImpl - update test in ExecutionSpecificationCreationEditPolicyUITest to avoid issues on Mac. - Fix header in InsertNestedExecutionCommand - restore deleted test after merge Change-Id: Ic08bb70eee73fb235fcb46876628e939deafdf14 Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
- Remove attempt to fix computation of coordinates in the LifelineBodyFigure (currently, same code as overridden method) Change-Id: I903b3c23925f5f74298119861beaa4ba6e729a2e Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
I solved all the conversation items, I left the one about test failure on mac platform, because I am interested in understanding the diff here. For the other ones, commit 348a8d6 and e65b707 solves all of them. For the diagram behaviour:
Finally, for the code formatting: looking at the history, it seems we have some trouble to keep consistency in formatting. I suspect we use different versions of EMF to generate code and / or do not apply the same actions after code generation. I did a format source code after generation / organize import and then a clean up using project profile (what I usually do when generating Papyrus diagram code). Even if I revert the edit plugin code and generate the code again, I get a lot of differences compared to the master branch. I am using EMF 2.14 for code generation. Except for the automatic creation of the action execution when attaching a sync message to an execution, I addressed all the topics from your review. Thank you again for that very valuable review! |
Ah, that makes sense. Good.
Okay, I can understand that motivation. Certainly, the worst would be to have nesting switch orientations within a stack, so this is a good compromise.
Cool. TDD FTW 😉
Yes, that sounds likely. Another good motivation for moving more of this logic out of the edit-policies and into the logical model where it can be shared by the edit-policies.
Yeah, I'm using Eclipse for Committers 2018-09, so that's EMF 2.15. Those templates can have some changes, hopefully only improvements, because the genmodel is still targeting EMF 2.14 run-time. However, our project configurations for JDT formatting and clean-up should take care of purely formatting issues (though the generated code may actually be semantically different). Probably we should standardize on the development environment, perhaps via an Oomph setup model for this project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, @rschnekenbu! I would just ask for one more change to update a test that skips on Mac but can readily be fixed to work on all platforms.
...e/papyrus/uml/diagram/sequence/runtime/internal/edit/policies/tests/ExecutionMoveUITest.java
Outdated
Show resolved
Hide resolved
@@ -806,4 +806,20 @@ public void testMakeCreatedAt__OptionalInt() { | |||
assertThat("Center line not moved", getFixture().getTop(), isPresent(expectedTop.getAsInt())); | |||
} | |||
|
|||
public void testMakeCreatedAt__OptionalInt__empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
- Fix test failure on MAC (no assume on y position at the beginning, but compute the initial position and then check element position compared to this initial position) Change-Id: I84df77c862bffa4faa7826b9d341af0ba3b55c81 Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
The test failure should be fixed now, thanks to commit 4ac2cc3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! Bingo. 👍
Solving conflicts by merging the master branch. This commit should be hopefully the last one on this PR! |
[WIP] Currently updating with new features implemented these last weeks (message reorient for example is not taken perfectly into account + anchoring for automatically created messages like reply message)