Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Downstream code should now depend on the diagram services module for that bean.

=== Bug fixes

- https://github.com/eclipse-syson/syson/issues/2359[#2359] [diagrams] Fix `Comment` graphical nodes so changing their background color no longer changes their border color.

=== Improvements

=== New features
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 @@ -29,6 +29,7 @@
import org.eclipse.sirius.components.diagrams.tests.navigation.DiagramNavigator;
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.graphql.EditSysMLImportedPackageNodeAppearanceMutationRunner;
import org.eclipse.syson.application.data.AllCustomNodesProjectData;
import org.eclipse.syson.application.nodes.SysMLImportedPackageNodeStyle;
Expand All @@ -40,8 +41,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 @@ -82,9 +81,7 @@ private Flux<DiagramRefreshedEventPayload> givenDiagramSubscription() {
}

@DisplayName("GIVEN a diagram, WHEN we edit all its appearance and reset changes, THEN the diagram is properly updated")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramIsProperlyUpdated() {
var flux = this.givenDiagramSubscription();
Expand Down Expand Up @@ -166,9 +163,7 @@ public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramI
}

@DisplayName("GIVEN a diagram, WHEN we edit two of its appearance and reset one change, THEN only one property is reset")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOnePropertyIsReset() {
var flux = this.givenDiagramSubscription();
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 @@ -29,6 +29,7 @@
import org.eclipse.sirius.components.diagrams.tests.navigation.DiagramNavigator;
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.graphql.EditSysMLNoteNodeAppearanceMutationRunner;
import org.eclipse.syson.application.data.AllCustomNodesProjectData;
import org.eclipse.syson.application.nodes.SysMLNoteNodeStyle;
Expand All @@ -40,8 +41,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 @@ -82,9 +81,7 @@ private Flux<DiagramRefreshedEventPayload> givenDiagramSubscription() {
}

@DisplayName("GIVEN a diagram, WHEN we edit all its appearance and reset changes, THEN the diagram is properly updated")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramIsProperlyUpdated() {
var flux = this.givenDiagramSubscription();
Expand Down Expand Up @@ -166,9 +163,7 @@ public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramI
}

@DisplayName("GIVEN a diagram, WHEN we edit two of its appearance and reset one change, THEN only one property is reset")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOnePropertyIsReset() {
var flux = this.givenDiagramSubscription();
Expand Down Expand Up @@ -209,6 +204,7 @@ public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOne
.allMatch(node -> node.getStyle() instanceof SysMLNoteNodeStyle)
.extracting(node -> (SysMLNoteNodeStyle) node.getStyle())
.allMatch(sysMLNoteNodeStyle -> "red".equals(sysMLNoteNodeStyle.getBackground()))
.allMatch(sysMLNoteNodeStyle -> "#000000".equals(sysMLNoteNodeStyle.getBorderColor()))
.allMatch(sysMLNoteNodeStyle -> sysMLNoteNodeStyle.getBorderSize() == 5);
});

Expand All @@ -230,6 +226,7 @@ public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOne
.allMatch(node -> node.getStyle() instanceof SysMLNoteNodeStyle)
.extracting(node -> (SysMLNoteNodeStyle) node.getStyle())
.allMatch(sysMLNoteNodeStyle -> "red".equals(sysMLNoteNodeStyle.getBackground()))
.allMatch(sysMLNoteNodeStyle -> "#000000".equals(sysMLNoteNodeStyle.getBorderColor()))
.allMatch(sysMLNoteNodeStyle -> sysMLNoteNodeStyle.getBorderSize() == 1);
});

Expand All @@ -243,4 +240,4 @@ public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOne
.verify(Duration.ofSeconds(10));
}

}
}
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 @@ -29,6 +29,7 @@
import org.eclipse.sirius.components.diagrams.tests.navigation.DiagramNavigator;
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.graphql.EditSysMLPackageNodeAppearanceMutationRunner;
import org.eclipse.syson.application.data.AllCustomNodesProjectData;
import org.eclipse.syson.application.nodes.SysMLPackageNodeStyle;
Expand All @@ -40,8 +41,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 @@ -82,9 +81,7 @@ private Flux<DiagramRefreshedEventPayload> givenDiagramSubscription() {
}

@DisplayName("GIVEN a diagram, WHEN we edit all its appearance and reset changes, THEN the diagram is properly updated")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramIsProperlyUpdated() {
var flux = this.givenDiagramSubscription();
Expand Down Expand Up @@ -166,9 +163,7 @@ public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramI
}

@DisplayName("GIVEN a diagram, WHEN we edit two of its appearance and reset one change, THEN only one property is reset")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOnePropertyIsReset() {
var flux = this.givenDiagramSubscription();
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 @@ -29,6 +29,7 @@
import org.eclipse.sirius.components.diagrams.tests.navigation.DiagramNavigator;
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.graphql.EditSysMLViewFrameNodeAppearanceMutationRunner;
import org.eclipse.syson.application.data.AllCustomNodesProjectData;
import org.eclipse.syson.application.nodes.SysMLViewFrameNodeStyle;
Expand All @@ -40,8 +41,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 @@ -82,9 +81,7 @@ private Flux<DiagramRefreshedEventPayload> givenDiagramSubscription() {
}

@DisplayName("GIVEN a diagram, WHEN we edit all its appearance and reset changes, THEN the diagram is properly updated")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramIsProperlyUpdated() {
var flux = this.givenDiagramSubscription();
Expand Down Expand Up @@ -169,9 +166,7 @@ public void givenDiagramWhenWeEditAllItsAppearanceAndResetChangesThenTheDiagramI
}

@DisplayName("GIVEN a diagram, WHEN we edit two of its appearance and reset one change, THEN only one property is reset")
@Sql(scripts = { AllCustomNodesProjectData.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({ AllCustomNodesProjectData.SCRIPT_PATH })
@Test
public void givenDiagramWhenWeEditTwoOfItsAppearanceAndResetOneChangeThenOnlyOnePropertyIsReset() {
var flux = this.givenDiagramSubscription();
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 All @@ -26,6 +26,8 @@ public class ProjectWithLibraryDependencyTestProjectData {

public static final String PROJECT_NAME = "ProjectUsingMyLibraryV1";

public static final String PROJECT_ID = "3a06824a-a634-42ea-918f-817adc4b17a3";

public static final String LIBRARY_PROJECT_ID = "c493d950-f81a-4e56-a454-f9e5ce1c839f";

public static final String EDITING_CONTEXT = "09ba2e1b-7f2b-4c5f-a536-9624ba470f74";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 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
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.syson.application.data;

import org.eclipse.syson.application.libraries.SysONLibraryImportTestServer;

/**
* Identifiers for the "ProjectUsingNoLibraries" project.
* <p>
* Tests relying on this test data should use the {@link SysONLibraryImportTestServer} annotation to ensure the project
* is loaded in the application.
* </p>
*
* @author flatombe
*/
public class ProjectWithoutLibraryDependencyTestProjectData {

public static final String PROJECT_ID = "85ed22a4-81ad-46ac-a584-bf7259cd8568";

public static final String EDITING_CONTEXT = "bb9678c1-8f2e-440f-be06-628d1930ffc2";

}
Loading
Loading