Skip to content

Commit e025793

Browse files
committed
[1052] Fix New Port In/Inout/Out tools in GeneralView
Bug: #1052 Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
1 parent 185a78e commit e025793

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Export to textual SysMLv2 is not fully implemented yet so there are still unhand
3535
- https://github.com/eclipse-syson/syson/issues/1003[#1003] Invalid label for `Usages` (e.g.: `Attribute Usage`) when their `Feature Value` aims to define "default" value.
3636
- https://github.com/eclipse-syson/syson/issues/1020[#1020] [general-view] The multiplicity should not be displayed on edges.
3737
- https://github.com/eclipse-syson/syson/issues/1009[#1009] [metamodel] Fix an issue where the diagram direct edit on graphical nodes could raise a backend error on unsettable enum attributes.
38+
- https://github.com/eclipse-syson/syson/issues/1052[#1052] [general-view] Fix an issue where the execution of "New Port In/Inout/Out" tools was failing.
3839

3940
=== Improvements
4041

@@ -95,7 +96,7 @@ The _Validation_ view show the results of the execution of the constraints on yo
9596

9697
=== Dependency update
9798

98-
- [releng] Switch to Sirius Web 2025.1.0
99+
- [releng] Switch to Sirius Web 2025.1.7
99100
- [releng] Upgrade `turbo` to version 2.3.3 (from 1.13.3 before)
100101
The `start` task used in our turbo configuration is now marked as `persistent` and as a result we have separated the `start` script from `syson` used to run the frontend in dev from from the `start` script from other packages used to build them in development mode by renaming the later to `build-dev`.
101102
- [releng] Switch to https://github.com/spring-projects/spring-boot/releases/tag/v3.4.1[Spring Boot 3.4.1].

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVSubNodeStructureCreationTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ private static Stream<Arguments> partUsageSiblingNodeParameters() {
236236
.map(TestNameGenerator::namedArguments);
237237
}
238238

239+
private static Stream<Arguments> directedPortsInPartDefinitionChildNodeParameters() {
240+
return Stream.of(
241+
Arguments.of(SysmlPackage.eINSTANCE.getPortUsage(), "ports", SysmlPackage.eINSTANCE.getDefinition_OwnedPort(), "New Port In"),
242+
Arguments.of(SysmlPackage.eINSTANCE.getPortUsage(), "ports", SysmlPackage.eINSTANCE.getDefinition_OwnedPort(), "New Port Inout"),
243+
Arguments.of(SysmlPackage.eINSTANCE.getPortUsage(), "ports", SysmlPackage.eINSTANCE.getDefinition_OwnedPort(), "New Port Out"))
244+
.map(TestNameGenerator::namedArguments);
245+
}
246+
239247
@BeforeEach
240248
public void setUp() {
241249
this.givenInitialServerState.initialize();
@@ -431,4 +439,18 @@ public void createPartUsageSiblingNodes(EClass childEClass, EReference containme
431439
this.diagram, this.verifier);
432440
this.semanticCheckerService.checkEditingContext(this.semanticCheckerService.getElementInParentSemanticChecker(parentLabel, containmentReference, childEClass), this.verifier);
433441
}
442+
443+
@Sql(scripts = { "/scripts/syson-test-database.sql" }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
444+
@Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))
445+
@ParameterizedTest
446+
@MethodSource("directedPortsInPartDefinitionChildNodeParameters")
447+
public void createDirectedPortsInPartDefinitionChildNodeParameters(EClass childEClass, String compartmentName, EReference containmentReference, String creationToolName) {
448+
EClass parentEClass = SysmlPackage.eINSTANCE.getPartDefinition();
449+
String parentLabel = "PartDefinition";
450+
this.creationTestsService.createNode(this.verifier, this.diagramDescriptionIdProvider, this.diagram, parentEClass, parentLabel, creationToolName);
451+
this.diagramCheckerService.checkDiagram(
452+
this.diagramCheckerService.getCompartmentNodeGraphicalChecker(this.diagram, this.diagramDescriptionIdProvider, parentLabel, parentEClass, containmentReference, compartmentName),
453+
this.diagram, this.verifier);
454+
this.semanticCheckerService.checkEditingContext(this.semanticCheckerService.getElementInParentSemanticChecker(parentLabel, containmentReference, childEClass), this.verifier);
455+
}
434456
}

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ public Element createCompartmentItemWithDirection(Element element, String eRefer
237237
if (item instanceof Element elementItem) {
238238
var membership = this.createAppropriateMembership(structuralFeature);
239239
element.getOwnedRelationship().add(membership);
240-
membership.getOwnedRelatedElement().add(result);
240+
membership.getOwnedRelatedElement().add(elementItem);
241241
result = this.elementInitializer(elementItem);
242-
if (directionLiteral != null && item instanceof Feature feature) {
242+
if (directionLiteral != null && elementItem instanceof Feature feature) {
243243
feature.setDirection(FeatureDirectionKind.get(directionLiteral));
244244
result.setDeclaredName(result.getName() + StringUtils.capitalize(directionLiteral));
245245
}

doc/content/modules/user-manual/pages/release-notes/2025.2.0.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Export to textual SysMLv2 is not fully implemented yet so there are still unhand
2828
- In diagrams, labels of `Usages` (e.g.: `Attribute Usages`) with a `Feature Value` relationship having the _initial_ property set to true now use the ":=" symbol instead of "=".
2929
- In diagrams, labels of `Usages` (e.g.: `Attribute Usages`) with a `Feature Value` relationship having the _default_ property set to true now display the _default_ keyword.
3030
- In the `General View` diagram, the multiplicity is no longer displayed on graphical edges to conform to the SysMLv2 specification.
31+
- In the `General View` diagram, fix an issue where the execution of `New Port In/Inout/Out` tools was failing.
3132

3233
== New features
3334

@@ -128,7 +129,7 @@ To do so, create a `@Primary @Configuration` that extend `SysMLDefaultLibrariesC
128129

129130
== Dependency update
130131

131-
- Switch to Sirius Web 2025.1.6
132+
- Switch to Sirius Web 2025.1.7
132133
- Switch to SysIDE 0.8.0
133134
- Upgrade `turbo` to version 2.3.3
134135
- Switch to Spring Boot 3.4.1

0 commit comments

Comments
 (0)