diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 9d5cb97f3..81d28a642 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -46,6 +46,7 @@ Stakeholders are by default represented with a dedicated graphical node connecte
- https://github.com/eclipse-syson/syson/issues/2111[#2111] [diagrams] Leverage the latest change of the selection dialog to allow creating a `Stakeholder` graphical node without specialization.
- https://github.com/eclipse-syson/syson/issues/2122[#2122] [diagrams] Leverage the latest change of the selection dialog to allow creating a `Subject` graphical node without specialization.
- https://github.com/eclipse-syson/syson/issues/2129[#2129] [diagrams] Leverage the latest change of the selection dialog to allow creating a `FlowUsage` from a `ConnectionUsage` without selection a `PayloadFeature`
+- https://github.com/eclipse-syson/syson/issues/2105[#2105] [explorer] In the _Explorer_ view, `Expression` elements now display their full textual representation.
=== New features
diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java
index 6b813fe08..a9a8a1177 100644
--- a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java
+++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java
@@ -46,9 +46,11 @@
import org.eclipse.sirius.web.tests.services.explorer.ExplorerEventSubscriptionRunner;
import org.eclipse.sirius.web.tests.services.representation.RepresentationIdBuilder;
import org.eclipse.syson.AbstractIntegrationTests;
+import org.eclipse.syson.GivenSysONServer;
import org.eclipse.syson.application.controller.explorer.testers.ExpandAllTreeItemTester;
import org.eclipse.syson.application.controller.explorer.testers.TreeItemContextMenuTester;
import org.eclipse.syson.application.controller.explorer.testers.TreePathTester;
+import org.eclipse.syson.application.data.ActionTransitionUsagesProjectData;
import org.eclipse.syson.application.data.GeneralViewEmptyTestProjectData;
import org.eclipse.syson.application.data.ProjectWithLibraryDependencyContainingCommentAndLibraryPackageTestProjectData;
import org.eclipse.syson.application.data.ProjectWithLibraryDependencyContainingLibraryPackageTestProjectData;
@@ -67,8 +69,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;
@@ -135,8 +135,7 @@ public void beforeEach() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN the available explorers are requested, THEN the SysON explorer is returned")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void getAvailableExplorersForSysMLv2Project() {
Map explorerVariables = Map.of(
@@ -150,8 +149,7 @@ public void getAvailableExplorersForSysMLv2Project() {
}
@DisplayName("GIVEN a SysON Studio Project, WHEN the available explorers are requested, THEN the Sirius Web explorer is returned")
- @Sql(scripts = { SysonStudioTestProjectData.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({ SysonStudioTestProjectData.SCRIPT_PATH })
@Test
public void getAvailableExplorersForStudioProject() {
TestTransaction.flagForCommit();
@@ -166,8 +164,7 @@ public void getAvailableExplorersForStudioProject() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed, THEN the libraries are visible and the root namespace and memberships are not visible")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithDefaultFilters() {
var optionalEditingContext = this.editingContextSearchService.findById(GeneralViewEmptyTestProjectData.EDITING_CONTEXT);
@@ -257,8 +254,7 @@ public void getExplorerContentWithDefaultFilters() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed with KerML and SysML libraries expanded, THEN the library models are visible")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithKerMLAndSysMLExpanded() {
var optionalEditingContext = this.editingContextSearchService.findById(GeneralViewEmptyTestProjectData.EDITING_CONTEXT);
@@ -319,8 +315,7 @@ public void getExplorerContentWithKerMLAndSysMLExpanded() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed with its root model expanded and the hide memberships and hide KerML libraries filters, THEN the root model is visible and is expanded")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void getRootContentWithHideMembershipsAndHideKerMLStandardLibraries() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID, SysONTreeFilterConstants.HIDE_KERML_STANDARD_LIBRARIES_TREE_FILTER_ID);
@@ -352,8 +347,7 @@ public void getRootContentWithHideMembershipsAndHideKerMLStandardLibraries() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN context menu is queried, THEN the menu is returned")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void getContextMenuOfModelAndLibraryDirectories() {
var optionalEditingContext = this.editingContextSearchService.findById(GeneralViewEmptyTestProjectData.EDITING_CONTEXT);
@@ -422,8 +416,7 @@ public void getContextMenuOfModelAndLibraryDirectories() {
}
@DisplayName("GIVEN an empty SysML Project, WHEN the tree path is queried, THEN the returned tree path should take into accounts the Explorer filters.")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void treePathQueryApplyExplorerFilters() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID, SysONTreeFilterConstants.HIDE_ROOT_NAMESPACES_ID);
@@ -472,8 +465,7 @@ public void treePathQueryApplyExplorerFilters() {
*
*/
@DisplayName("GIVEN an empty SysML Project, WHEN the tree path is queried in the Sirius Web default Explorer, THEN the returned tree path should not take into accounts the Explorer filters.")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void treePathQueryInSiriusWebDefaultExplorerDoesNotApplyExplorerFilters() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID, SysONTreeFilterConstants.HIDE_ROOT_NAMESPACES_ID);
@@ -543,9 +535,7 @@ public void treePathQueryInSiriusWebDefaultExplorerDoesNotApplyExplorerFilters()
}
@DisplayName("GIVEN a SysML Project with a dependency to a library containing one Package, WHEN the explorer is displayed, THEN the library model is visible at the root of the explorer")
- @Sql(scripts = { ProjectWithUsedBatmobileLibraryDependencyTestProjectData.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({ ProjectWithUsedBatmobileLibraryDependencyTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithImportedLibraryContainingOnePackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -573,9 +563,7 @@ public void getExplorerContentWithImportedLibraryContainingOnePackage() {
}
@DisplayName("GIVEN a SysML Project with a dependency to a library containing one Package and one LibraryPackage, WHEN the explorer is displayed, THEN the library model is visible at the root of the explorer")
- @Sql(scripts = { ProjectWithLibraryDependencyContainingPackageAndLibraryPackageTestProjectData.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({ ProjectWithLibraryDependencyContainingPackageAndLibraryPackageTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithImportedLibraryContainingPackageAndLibraryPackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -603,9 +591,7 @@ public void getExplorerContentWithImportedLibraryContainingPackageAndLibraryPack
}
@DisplayName("GIVEN a SysML Project with a dependency to a library containing one LibraryPackage, WHEN the explorer is displayed, THEN the library model is visible under the user libraries directory of the explorer")
- @Sql(scripts = { ProjectWithLibraryDependencyContainingLibraryPackageTestProjectData.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({ ProjectWithLibraryDependencyContainingLibraryPackageTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithImportedLibraryContainingLibraryPackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -658,9 +644,7 @@ public void getExplorerContentWithImportedLibraryContainingLibraryPackage() {
}
@DisplayName("GIVEN a SysML Project with a dependency to a library containing a Comment and a LibraryPackage, WHEN the explorer is displayed, THEN the library model is visible under the user libraries directory of the explorer")
- @Sql(scripts = { ProjectWithLibraryDependencyContainingCommentAndLibraryPackageTestProjectData.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({ ProjectWithLibraryDependencyContainingCommentAndLibraryPackageTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentWithImportedLibraryContainingCommentAndLibraryPackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -713,9 +697,7 @@ public void getExplorerContentWithImportedLibraryContainingCommentAndLibraryPack
}
@DisplayName("GIVEN a SysML library containing a LibraryPackage, WHEN the explorer is displayed on the library's semantic data, THEN the library model is visible at the root of the explorer")
- @Sql(scripts = { ProjectWithLibraryDependencyContainingLibraryPackageTestProjectData.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({ ProjectWithLibraryDependencyContainingLibraryPackageTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentOnLibrarySemanticDataWithLibraryPackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -742,9 +724,7 @@ public void getExplorerContentOnLibrarySemanticDataWithLibraryPackage() {
}
@DisplayName("GIVEN a SysML library containing a Package and a LibraryPackage, WHEN the explorer is displayed on the library's semantic data, THEN the library model is visible at the root of the explorer")
- @Sql(scripts = { ProjectWithLibraryDependencyContainingPackageAndLibraryPackageTestProjectData.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({ ProjectWithLibraryDependencyContainingPackageAndLibraryPackageTestProjectData.SCRIPT_PATH })
@Test
public void getExplorerContentOnLibrarySemanticDataWithPackage() {
List filters = List.of(SysONTreeFilterConstants.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID);
@@ -771,8 +751,7 @@ public void getExplorerContentOnLibrarySemanticDataWithPackage() {
}
@DisplayName("GIVEN the SysON Explorer, WHEN tree item context menu is requested, THEN the returned tree items are the appropriate one.")
- @Sql(scripts = { GeneralViewEmptyTestProjectData.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({ GeneralViewEmptyTestProjectData.SCRIPT_PATH })
@Test
public void sysONExplorerTreeItemContextMenuEntriesTest() {
var expandedItemIds = List.of(
@@ -871,4 +850,69 @@ public void sysONExplorerTreeItemContextMenuEntriesTest() {
.verify(Duration.ofSeconds(10));
}
+
+ @DisplayName("GIVEN the SysON Explorer, WHEN displaying an Expression item, THEN the item's label shows the textual representation of the expression")
+ @GivenSysONServer({ ActionTransitionUsagesProjectData.SCRIPT_PATH })
+ @Test
+ public void sysONExplorerTreeExpressionLabelTest() {
+
+ var optionalEditingContext = this.editingContextSearchService.findById(ActionTransitionUsagesProjectData.EDITING_CONTEXT_ID);
+ TreeDescription treeDescription = optionalEditingContext
+ .flatMap(editingContext -> this.representationDescriptionSearchService.findById(editingContext, this.sysONExplorerTreeDescriptionId))
+ .filter(TreeDescription.class::isInstance)
+ .map(TreeDescription.class::cast)
+ .orElse(null);
+ List defaultFilters = this.sysonTreeFilterProvider.get(null, treeDescription).stream()
+ .filter(TreeFilter::defaultState)
+ .map(TreeFilter::id)
+ .toList();
+
+ var expandedItemIds = List.of(
+ ActionTransitionUsagesProjectData.SemanticIds.DOCUMENT_ID,
+ ActionTransitionUsagesProjectData.SemanticIds.PACKAGE_1_ID,
+ ActionTransitionUsagesProjectData.SemanticIds.A0_ID,
+ ActionTransitionUsagesProjectData.SemanticIds.S1_ID,
+ ActionTransitionUsagesProjectData.SemanticIds.S2_ID);
+
+ var explorerRepresentationId = this.representationIdBuilder.buildExplorerRepresentationId(this.sysONExplorerTreeDescriptionId, expandedItemIds, defaultFilters);
+ var input = new ExplorerEventInput(UUID.randomUUID(), ActionTransitionUsagesProjectData.EDITING_CONTEXT_ID, explorerRepresentationId);
+ var flux = this.explorerEventSubscriptionRunner.run(input).flux();
+ TestTransaction.flagForCommit();
+ TestTransaction.end();
+
+ var treeId = new AtomicReference();
+ Consumer