Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
= Changelog

== v2026.3.0 (work in progress)

== v2026.5.0 (work in progress)
=== Shapes

=== Breaking changes

- [cleanup] The definition of the tools specific to the requirements table has been moved to the backend.
As a result, the following GraphQL mutations have been removed `exposeRequirements` and `createRequirement`.
- [test] Reduce our call to `DiagramNavigator#nodeWithTargetObjectLabel` which has been deprecated for removal.
+ The API of `ToolTester#invokeTool` and `NodeCreationTestsService#createNode` has been updated accordingly to take a `targetObjectId` instead of a `label`.

=== Dependency update

=== Bug fixes

=== Improvements

=== New features


== v2026.3.0

=== Breaking changes

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2025 Obeo.
* Copyright (c) 2025, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -35,7 +35,7 @@ public class CheckBorderNode implements IDiagramChecker {

private final DiagramComparator diagramComparator;

private String parentLabel;
private String parentTargetObjectId;

private String borderNodeDescriptionName;

Expand All @@ -44,8 +44,8 @@ public CheckBorderNode(DiagramDescriptionIdProvider diagramDescriptionIdProvider
this.diagramComparator = diagramComparator;
}

public CheckBorderNode withParentLabel(String expectedParentLabel) {
this.parentLabel = expectedParentLabel;
public CheckBorderNode withParentTargetObjectId(String expectedParentTargetObjectId) {
this.parentTargetObjectId = expectedParentTargetObjectId;
return this;
}

Expand All @@ -58,7 +58,7 @@ public CheckBorderNode hasBorderNodeDescriptionName(String expectedBorderNodeDes
public void check(Diagram previousDiagram, Diagram newDiagram) {
List<Node> newNodes = this.diagramComparator.newNodes(previousDiagram, newDiagram);
DiagramNavigator diagramNavigator = new DiagramNavigator(newDiagram);
var parentNode = diagramNavigator.nodeWithTargetObjectLabel(this.parentLabel).getNode();
var parentNode = diagramNavigator.nodeWithTargetObjectId(this.parentTargetObjectId).getNode();
assertThat(parentNode.getBorderNodes()).anySatisfy(borderNode -> {
String borderNodeDescriptionId = this.diagramDescriptionIdProvider.getNodeDescriptionId(this.borderNodeDescriptionName);
assertThat(borderNode).hasDescriptionId(borderNodeDescriptionId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024, 2025 Obeo.
* Copyright (c) 2024, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -35,7 +35,7 @@ public class CheckChildNode implements IDiagramChecker {

private final DiagramComparator diagramComparator;

private String parentLabel;
private String parentTargetObjectId;

private String parentNodeId;

Expand All @@ -48,8 +48,8 @@ public CheckChildNode(DiagramDescriptionIdProvider diagramDescriptionIdProvider,
this.diagramComparator = Objects.requireNonNull(diagramComparator);
}

public CheckChildNode withParentLabel(String expectedParentLabel) {
this.parentLabel = expectedParentLabel;
public CheckChildNode withParentTargetObjectId(String expectedParentTargetObjectId) {
this.parentTargetObjectId = expectedParentTargetObjectId;
return this;
}

Expand All @@ -76,7 +76,7 @@ public void check(Diagram previousDiagram, Diagram newDiagram) {
if (this.parentNodeId != null) {
parentNode = diagramNavigator.nodeWithId(this.parentNodeId).getNode();
} else {
parentNode = diagramNavigator.nodeWithTargetObjectLabel(this.parentLabel).getNode();
parentNode = diagramNavigator.nodeWithTargetObjectId(this.parentTargetObjectId).getNode();
}
assertThat(parentNode).isNotNull();
assertThat(parentNode.getChildNodes()).anySatisfy(childNode -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024, 2025 Obeo.
* Copyright (c) 2024, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -36,7 +36,7 @@ public class CheckNodeInCompartment implements IDiagramChecker {

private final DiagramComparator diagramComparator;

private String parentLabel;
private String targetObjectId;

private String compartmentName;

Expand All @@ -51,8 +51,8 @@ public CheckNodeInCompartment(DiagramDescriptionIdProvider diagramDescriptionIdP
this.diagramComparator = diagramComparator;
}

public CheckNodeInCompartment withParentLabel(String expectedParentLabel) {
this.parentLabel = expectedParentLabel;
public CheckNodeInCompartment withTargetObjectId(String expectedTargetObjectId) {
this.targetObjectId = expectedTargetObjectId;
return this;
}

Expand Down Expand Up @@ -80,7 +80,7 @@ public CheckNodeInCompartment isRevealed() {
public void check(Diagram previousDiagram, Diagram newDiagram) {
List<Node> newNodes = this.diagramComparator.newNodes(previousDiagram, newDiagram);
DiagramNavigator diagramNavigator = new DiagramNavigator(newDiagram);
var compartmentNode = diagramNavigator.nodeWithTargetObjectLabel(this.parentLabel)
var compartmentNode = diagramNavigator.nodeWithTargetObjectId(this.targetObjectId)
.childNodeWithLabel(this.compartmentName)
.getNode();
assertThat(compartmentNode.getChildNodes()).anySatisfy(childNode -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public DiagramCheckerService(DiagramComparator diagramComparator, IDescriptionNa
* the reference to the previous diagram state
* @param diagramDescriptionIdProvider
* the provider for diagram description IDs
* @param parentLabel
* the label of the parent node
* @param parentTargetObjectId
* the parent target object ID
* @param childEClass
* the EClass of the expected child node
* @param compartmentCount
Expand All @@ -65,7 +65,7 @@ public DiagramCheckerService(DiagramComparator diagramComparator, IDescriptionNa
* the expected total number of new border nodes
* @return a consumer that performs the graphical check
*/
public Consumer<Object> childNodeGraphicalChecker(AtomicReference<Diagram> previousDiagram, DiagramDescriptionIdProvider diagramDescriptionIdProvider, String parentLabel, EClass childEClass,
public Consumer<Object> childNodeGraphicalChecker(AtomicReference<Diagram> previousDiagram, DiagramDescriptionIdProvider diagramDescriptionIdProvider, String parentTargetObjectId, EClass childEClass,
int compartmentCount, int newNodesCount, int newBorderNodesCount) {
return assertRefreshedDiagramThat(newDiagram -> {
new CheckDiagramElementCount(this.diagramComparator)
Expand All @@ -76,7 +76,7 @@ public Consumer<Object> childNodeGraphicalChecker(AtomicReference<Diagram> previ

String newNodeDescriptionName = this.descriptionNameGenerator.getNodeName(childEClass);
new CheckChildNode(diagramDescriptionIdProvider, this.diagramComparator)
.withParentLabel(parentLabel)
.withParentTargetObjectId(parentTargetObjectId)
.hasNodeDescriptionName(newNodeDescriptionName)
.hasCompartmentCount(compartmentCount)
.check(previousDiagram.get(), newDiagram);
Expand All @@ -90,8 +90,8 @@ public Consumer<Object> childNodeGraphicalChecker(AtomicReference<Diagram> previ
* the reference to the previous diagram state
* @param diagramDescriptionIdProvider
* the provider for diagram description IDs
* @param parentLabel
* the label of the parent node
* @param parentTargetObjectId
* the parent target object ID
* @param parentEClass
* the EClass of the parent node
* @param containmentReference
Expand All @@ -102,7 +102,7 @@ public Consumer<Object> childNodeGraphicalChecker(AtomicReference<Diagram> previ
* check only new nodes and edges that are visible on the diagram
* @return a consumer that performs the graphical check
*/
public Consumer<Object> compartmentNodeGraphicalChecker(AtomicReference<Diagram> previousDiagram, DiagramDescriptionIdProvider diagramDescriptionIdProvider, String parentLabel,
public Consumer<Object> compartmentNodeGraphicalChecker(AtomicReference<Diagram> previousDiagram, DiagramDescriptionIdProvider diagramDescriptionIdProvider, String parentTargetObjectId,
EClass parentEClass, EReference containmentReference, String compartmentName, boolean onlyNewVisibleNodesAndEdges) {
return assertRefreshedDiagramThat(newDiagram -> {
new CheckDiagramElementCount(this.diagramComparator)
Expand All @@ -112,7 +112,7 @@ public Consumer<Object> compartmentNodeGraphicalChecker(AtomicReference<Diagram>

String newNodeDescriptionName = this.descriptionNameGenerator.getCompartmentItemName(parentEClass, containmentReference);
new CheckNodeInCompartment(diagramDescriptionIdProvider, this.diagramComparator)
.withParentLabel(parentLabel)
.withTargetObjectId(parentTargetObjectId)
.withCompartmentName(compartmentName)
.hasNodeDescriptionName(newNodeDescriptionName)
.hasCompartmentCount(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eclipse.sirius.components.view.emf.diagram.IDiagramIdProvider;
import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState;
import org.eclipse.syson.AbstractIntegrationTests;
import org.eclipse.syson.GivenSysONServer;
import org.eclipse.syson.application.controllers.diagrams.testers.ToolTester;
import org.eclipse.syson.application.data.ActionTransitionUsagesProjectData;
import org.eclipse.syson.services.diagrams.DiagramDescriptionIdProvider;
Expand All @@ -47,8 +48,6 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlConfig;
import org.springframework.test.context.transaction.TestTransaction;
import org.springframework.transaction.annotation.Transactional;

Expand Down Expand Up @@ -114,10 +113,8 @@ public void tearDown() {
}
}

@Sql(scripts = { ActionTransitionUsagesProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD,
config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))
@Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))
@DisplayName("GIVEN a model with TransitionUsage ending on 'start' or 'done' ActionUsage, WHEN adding existing nested element on the parent of the TransitionUsage, THEN the 'start' and 'done' node should be added to the ActionFlow compartment.")
@GivenSysONServer({ ActionTransitionUsagesProjectData.SCRIPT_PATH })
@Test
public void addExistingNestedElementsOnActionUsage() {
TestTransaction.flagForCommit();
Expand All @@ -126,7 +123,7 @@ public void addExistingNestedElementsOnActionUsage() {
"Add existing nested elements");
assertThat(toolId).as("The tool 'Add existing elements' should exist on Action Usage").isNotNull();

this.verifier.then(() -> this.nodeCreationTester.invokeTool(ActionTransitionUsagesProjectData.EDITING_CONTEXT_ID, this.diagram, "a0", toolId));
this.verifier.then(() -> this.nodeCreationTester.invokeTool(ActionTransitionUsagesProjectData.EDITING_CONTEXT_ID, this.diagram, ActionTransitionUsagesProjectData.SemanticIds.A0_ID, toolId));

Consumer<DiagramRefreshedEventPayload> updatedDiagramConsumer = payload -> Optional.of(payload)
.map(DiagramRefreshedEventPayload::diagram)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2025 Obeo.
* Copyright (c) 2025, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -28,6 +28,7 @@
import org.eclipse.sirius.components.view.emf.diagram.IDiagramIdProvider;
import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState;
import org.eclipse.syson.AbstractIntegrationTests;
import org.eclipse.syson.GivenSysONServer;
import org.eclipse.syson.application.controllers.diagrams.testers.ToolTester;
import org.eclipse.syson.application.data.GeneralViewWithTopNodesTestProjectData;
import org.eclipse.syson.services.diagrams.DiagramDescriptionIdProvider;
Expand All @@ -43,8 +44,6 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlConfig;
import org.springframework.transaction.annotation.Transactional;

import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -92,9 +91,7 @@ public void beforeEach() {
}

@DisplayName("GIVEN an ActionUsage action1, WHEN using the 'New Start Action' tool is executed on action1, THEN the action flow compartment of action1 is revealed.")
@Sql(scripts = { GeneralViewWithTopNodesTestProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD,
config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))
@Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))
@GivenSysONServer({ GeneralViewWithTopNodesTestProjectData.SCRIPT_PATH })
@Test
public void addStartNode() {
var flux = this.givenSubscriptionToDiagram();
Expand All @@ -117,7 +114,7 @@ public void addStartNode() {
});

Runnable invokeTool = () -> {
this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, "action", toolId);
this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, GeneralViewWithTopNodesTestProjectData.SemanticIds.ACTION_USAGE_ID, toolId);
};

Consumer<Object> updatedDiagramConsumer = assertRefreshedDiagramThat(diag -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void checkItemParameterOnActionDefinition() {

Consumer<Object> initialDiagramContentConsumer = assertRefreshedDiagramThat(diagram::set);

Runnable newCreationTool = () -> this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, "UseCaseDefinition", creationToolId, variables);
Runnable newCreationTool = () -> this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, GeneralViewWithTopNodesTestProjectData.SemanticIds.USE_CASE_DEFINITION_ID, creationToolId, variables);

Consumer<Object> updatedDiagramConsumer = assertRefreshedDiagramThat(newDiagram -> {
new CheckDiagramElementCount(this.diagramComparator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void testApplyNewExhibitStateWithReferencedStateToolFromPartUsage() {
String creationToolId = diagramDescriptionIdProvider.getNodeToolId(this.descriptionNameGenerator.getNodeName(SysmlPackage.eINSTANCE.getPartUsage()), "New Exhibit State with referenced State");
assertThat(creationToolId).as("The tool 'New Exhibit State with referenced State' should exist on a PartUsage").isNotNull();

Runnable invokeTool = () -> this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, "part", creationToolId,
Runnable invokeTool = () -> this.nodeCreationTester.invokeTool(GeneralViewWithTopNodesTestProjectData.EDITING_CONTEXT_ID, diagram, GeneralViewWithTopNodesTestProjectData.SemanticIds.PART_USAGE_ID, creationToolId,
List.of(new ToolVariable("selectedObject", GeneralViewWithTopNodesTestProjectData.SemanticIds.STATE_USAGE_ID, ToolVariableType.OBJECT_ID)));

String[] newExhibitStateId = new String[1];
Expand Down
Loading
Loading