From b871dba9937046be4d5e79edaf87d4a7a78c5a16 Mon Sep 17 00:00:00 2001 From: jan-vcapgemini Date: Tue, 14 Mar 2023 14:19:56 +0100 Subject: [PATCH] #1454 replaced ArtifactReader with TemplateSetReader added new constructor to TemplateSetConfiguration (used for empty reader initialization) removed temporary initialzation of HomeController (needs to be replaced with core template set reader) simplified buildTreeView method in TreeViewBuilder replaced all template-set.xml files with a valid version (added increments) --- .../TemplateSetConfigurationReader.java | 9 +++ .../com/devonfw/cobigen/gui/Controller.java | 17 ++--- .../gui/controllers/DetailsController.java | 16 ++--- .../gui/controllers/HomeController.java | 27 ++++--- .../gui/controllers/MenuController.java | 8 +-- .../cobigen/gui/model/TemplateSetModel.java | 12 ++-- .../cobigen/gui/services/TemplateSetCell.java | 9 ++- .../gui/services/TemplateSetCellFactory.java | 7 +- .../cobigen/gui/services/TreeViewBuilder.java | 29 ++------ .../cobigen/gui/ProcessTemplateSetTest.java | 28 +++++--- .../cobigen/gui/TemplateSetDetailsTest.java | 30 ++++---- .../com/devonfw/cobigen/gui/TestFXBase.java | 6 +- ...va-server-app-2021.12.007-template-set.xml | 70 +++++++++---------- .../TemplateSetDetailsTest/template-set.xml | 70 +++++++++---------- 14 files changed, 169 insertions(+), 169 deletions(-) diff --git a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java index 4248d42ae9..b2744345be 100644 --- a/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java +++ b/cobigen/cobigen-core/src/main/java/com/devonfw/cobigen/impl/config/reader/TemplateSetConfigurationReader.java @@ -100,6 +100,15 @@ public TemplatesConfiguration getTemplatesConfiguration() { // TODO: Use dependency injection here instead of the new operator private final TemplateSetConfigurationManager templateSetConfigurationManager = new TemplateSetConfigurationManager(); + /** + * + * The constructor for the artifact reader. + */ + public TemplateSetConfigurationReader() { + + this.configRoot = null; + } + /** * The constructor. * diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java index 82fbe9f58d..a9272bfca3 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java @@ -9,8 +9,8 @@ import com.devonfw.cobigen.gui.controllers.HomeController; import com.devonfw.cobigen.gui.controllers.MenuController; import com.devonfw.cobigen.gui.services.TreeViewBuilder; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSetIncrement; +import com.devonfw.cobigen.impl.config.entity.io.Increment; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -107,7 +107,7 @@ public void loadHome(javafx.event.ActionEvent actionEvent) throws IOException { public void loadDetails() throws IOException { // selected from observable list - TemplateSet selectedItem = this.menuController.searchResultsView.getSelectionModel().getSelectedItem(); + TemplateSetConfiguration selectedItem = this.menuController.searchResultsView.getSelectionModel().getSelectedItem(); // changing visibility between scenes if (selectedItem == null) { this.home.setVisible(true); @@ -119,18 +119,13 @@ public void loadDetails() throws IOException { // Getting the tree view of increments of selected template set // Extract all increments from selected templateSet in list - // should not happen here - List templatesetIncrements = selectedItem.getTemplateSetConfiguration() - .getTemplatesConfiguration().getIncrements().getIncrementList(); - - // icnrements converted to strings to make it ready for tree view builder - String[] increments = TreeViewBuilder.transformIncrementsToArray(templatesetIncrements); + List templatesetIncrements = selectedItem.getTemplatesConfiguration().getIncrements().getIncrement(); // shows the tree view of increments of selected template set - this.detailsController.showTreeView(TreeViewBuilder.buildTreeView(increments)); + this.detailsController.showTreeView(TreeViewBuilder.buildTreeView(templatesetIncrements)); // TODO - this.detailsController.showName(selectedItem.getTemplateSetVersion()); + this.detailsController.showName(selectedItem.getVersion().toString()); // retrieving template-Set selected and pass it to details Controller this.detailsController diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/DetailsController.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/DetailsController.java index 84d29b2d69..50558dfa92 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/DetailsController.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/DetailsController.java @@ -14,8 +14,8 @@ import com.devonfw.cobigen.api.util.CobiGenPaths; import com.devonfw.cobigen.api.util.MavenCoordinate; import com.devonfw.cobigen.api.util.TemplatesJarUtil; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import com.devonfw.cobigen.retriever.ArtifactRetriever; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; import javafx.fxml.FXML; import javafx.fxml.Initializable; @@ -38,7 +38,7 @@ public class DetailsController implements Initializable { // TODO: getIncrements() private List INCREMENTS = new ArrayList<>(); - private TemplateSet templateSet; + private TemplateSetConfiguration templateSet; @FXML Label titleLabel; @@ -80,7 +80,7 @@ public void updateTemplateSetInstallStatus() { * * @return templateSet */ - public TemplateSet getTemplateSet() { + public TemplateSetConfiguration getTemplateSet() { return this.templateSet; } @@ -90,7 +90,7 @@ public TemplateSet getTemplateSet() { * * @param templateSet new value of {@link #gettemplateSet}. */ - public void setTemplateSet(TemplateSet templateSet) { + public void setTemplateSet(TemplateSetConfiguration templateSet) { this.templateSet = templateSet; } @@ -135,9 +135,9 @@ public void showTreeView(TreeView treeView) { private Path retrieveJarPathFromTemplateSet() { // Retrieve template set name information from trigger - String triggerName = this.templateSet.getTemplateSetConfiguration().getContextConfiguration().getTriggers().getId(); + String triggerName = this.templateSet.getContextConfiguration().getTrigger().get(0).getId(); String mavenArtfifactId = triggerName.replace("_", "-"); - String templateSetVersion = this.templateSet.getTemplateSetVersion(); + String templateSetVersion = this.templateSet.getVersion().toString(); Path templateSetsPath = CobiGenPaths.getTemplateSetsFolderPath(); // Adjust file name @@ -156,9 +156,9 @@ private Path retrieveJarPathFromTemplateSet() { public void installTemplateSet(javafx.event.ActionEvent actionEvent) { // Retrieve template set name information from trigger - String triggerName = this.templateSet.getTemplateSetConfiguration().getContextConfiguration().getTriggers().getId(); + String triggerName = this.templateSet.getContextConfiguration().getTrigger().get(0).getId(); String mavenArtfifactId = triggerName.replace("_", "-"); - String templateSetVersion = this.templateSet.getTemplateSetVersion(); + String templateSetVersion = this.templateSet.getVersion().toString(); // Adjust file name String FileName = mavenArtfifactId + "-" + templateSetVersion + ".jar"; diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/HomeController.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/HomeController.java index c5d18cf5cd..b3f491848e 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/HomeController.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/HomeController.java @@ -8,13 +8,11 @@ import java.util.ResourceBundle; import com.devonfw.cobigen.gui.App; -import com.devonfw.cobigen.gui.services.TreeViewBuilder; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.Scene; import javafx.scene.control.MenuButton; -import javafx.scene.control.TreeView; import javafx.scene.layout.AnchorPane; /** @@ -42,14 +40,23 @@ public class HomeController implements Initializable { @Override public void initialize(URL location, ResourceBundle resources) { - // Build the tree view - TreeView treeView = TreeViewBuilder.buildTreeView(this.EXAMPLE_LIST); - treeView.setId("treeView"); - AnchorPane.setTopAnchor(treeView, 0.0); - AnchorPane.setRightAnchor(treeView, 0.0); - AnchorPane.setBottomAnchor(treeView, 0.0); - AnchorPane.setLeftAnchor(treeView, 0.0); - this.treeViewPane.getChildren().add(treeView); + // Increment increment1 = new Increment(); + // increment1.setName("Title of Increment 1"); + // increment1.setDescription("Description of Increment 1"); + // Increment increment2 = new Increment(); + // increment2.setName("Title of Increment 2"); + // increment2.setDescription("Description of Increment 2"); + // Increment increment3 = new Increment(); + // increment3.setName("Title of Increment 3"); + // increment3.setDescription("Description of Increment 3"); + // // Build the tree view + // TreeView treeView = TreeViewBuilder.buildTreeView(this.EXAMPLE_LIST); + // treeView.setId("treeView"); + // AnchorPane.setTopAnchor(treeView, 0.0); + // AnchorPane.setRightAnchor(treeView, 0.0); + // AnchorPane.setBottomAnchor(treeView, 0.0); + // AnchorPane.setLeftAnchor(treeView, 0.0); + // this.treeViewPane.getChildren().add(treeView); } /** diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java index c18bfe7110..058fa73122 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java @@ -7,7 +7,7 @@ import com.devonfw.cobigen.gui.Controller; import com.devonfw.cobigen.gui.model.TemplateSetModel; import com.devonfw.cobigen.gui.services.TemplateSetCell; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; @@ -39,7 +39,7 @@ public class MenuController implements Initializable { public Button goSearch; @FXML - public ListView searchResultsView; + public ListView searchResultsView; /** * The constructor. @@ -94,8 +94,8 @@ public void initialize(URL location, ResourceBundle resources) { // Initialize filtered List - ObservableList listCopy = TemplateSetModel.getInstance().getTemplateSetObservableList(); - FilteredList filteredData = new FilteredList<>( + ObservableList listCopy = TemplateSetModel.getInstance().getTemplateSetObservableList(); + FilteredList filteredData = new FilteredList<>( TemplateSetModel.getInstance().getTemplateSetObservableList(), b -> true); // look after the searched text in search bar diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/model/TemplateSetModel.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/model/TemplateSetModel.java index 3756a96d2f..f21d16953e 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/model/TemplateSetModel.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/model/TemplateSetModel.java @@ -7,8 +7,7 @@ import java.util.List; import com.devonfw.cobigen.api.util.CobiGenPaths; -import com.devonfw.cobigen.retriever.ArtifactRetriever; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.collections.FXCollections; import javafx.collections.ObservableList; @@ -20,7 +19,7 @@ public class TemplateSetModel { private static TemplateSetModel tsModel; - private final ObservableList templateSetObservableList; + private final ObservableList templateSetObservableList; private TemplateSetModel() { @@ -40,7 +39,7 @@ public static TemplateSetModel getInstance() { /** * @return templateSetObservableList */ - public ObservableList getTemplateSetObservableList() { + public ObservableList getTemplateSetObservableList() { return this.templateSetObservableList; } @@ -56,9 +55,10 @@ public void loadAllAvailableTemplateSets() { templateSetFiles.add(Paths.get(file.getPath())); } - List templateSets = ArtifactRetriever.retrieveTemplateSetData(templateSetFiles); + // List templateSets = ArtifactRetriever + // .retrieveTemplateSetData(templateSetFiles); - this.templateSetObservableList.addAll(templateSets); + // this.templateSetObservableList.addAll(templateSets); } } diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java index 2429980059..cafbdc0760 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java @@ -2,7 +2,7 @@ import java.io.IOException; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; @@ -15,7 +15,7 @@ * TODO nneuhaus This type ... * */ -public class TemplateSetCell extends ListCell { +public class TemplateSetCell extends ListCell { FXMLLoader loader; @@ -30,7 +30,7 @@ public class TemplateSetCell extends ListCell { // when this method suppose to be called @Override - protected void updateItem(TemplateSet templateSet, boolean empty) { + protected void updateItem(TemplateSetConfiguration templateSet, boolean empty) { super.updateItem(templateSet, empty); if (empty || templateSet == null) { @@ -50,8 +50,7 @@ protected void updateItem(TemplateSet templateSet, boolean empty) { } } // name of template set. should not happen here - this.titleLabel - .setText(templateSet.getTemplateSetConfiguration().getContextConfiguration().getTriggers().getId()); + this.titleLabel.setText(templateSet.getContextConfiguration().getTrigger().get(0).getId()); this.installButton.setOnAction(event -> { System.out.println("INSTALLIEREN!!!"); }); diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java index 2d4cea3561..af739982d0 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java @@ -1,6 +1,6 @@ package com.devonfw.cobigen.gui.services; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; @@ -10,10 +10,11 @@ * TODO nneuhaus This type ... * */ -public class TemplateSetCellFactory implements Callback, ListCell> { +public class TemplateSetCellFactory + implements Callback, ListCell> { @Override - public ListCell call(ListView param) { + public ListCell call(ListView param) { return new TemplateSetCell(); } diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TreeViewBuilder.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TreeViewBuilder.java index a4532eb734..88620c12d2 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TreeViewBuilder.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TreeViewBuilder.java @@ -2,7 +2,7 @@ import java.util.List; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSetIncrement; +import com.devonfw.cobigen.impl.config.entity.io.Increment; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; @@ -13,37 +13,18 @@ */ public class TreeViewBuilder { - /** - * Extract template set increments detail - * - * @param templateSetIncrements - * @return the string array of increment descriptions - */ - public static String[] transformIncrementsToArray(List templateSetIncrements) { - - String[] incrementsWithDescriptions = new String[templateSetIncrements.size() * 2]; - - for (int i = 0, j = 0; i < templateSetIncrements.size(); i++) { - incrementsWithDescriptions[j++] = templateSetIncrements.get(i).getName(); - - incrementsWithDescriptions[j++] = templateSetIncrements.get(i).getDescription(); - } - return incrementsWithDescriptions; - } - /** * @param arrayOfItems to transform to tree * @return the complete TreeView */ - public static TreeView buildTreeView(String[] arrayOfItems) { + public static TreeView buildTreeView(List arrayOfItems) { TreeItem rootItem = new TreeItem<>("Increments"); rootItem.setExpanded(true); - for (int i = 0; i < arrayOfItems.length; i++) { - TreeItem increment = new TreeItem<>(arrayOfItems[i]); - i++; - TreeItem incrementDescription = new TreeItem<>(arrayOfItems[i]); + for (Increment i : arrayOfItems) { + TreeItem increment = new TreeItem<>(i.getName()); + TreeItem incrementDescription = new TreeItem<>(i.getDescription()); increment.getChildren().add(incrementDescription); rootItem.getChildren().add(increment); } diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java index 6b0bd00f4a..080d02d12e 100644 --- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java +++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/ProcessTemplateSetTest.java @@ -13,8 +13,8 @@ import org.testfx.util.WaitForAsyncUtils; import com.devonfw.cobigen.api.constants.ConfigurationConstants; -import com.devonfw.cobigen.retriever.reader.TemplateSetArtifactReader; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; +import com.devonfw.cobigen.impl.config.reader.TemplateSetConfigurationReader; import javafx.collections.FXCollections; import javafx.scene.control.Button; @@ -29,8 +29,11 @@ public class ProcessTemplateSetTest extends TestFXBase { @Rule public TemporaryFolder tmpFolder = new TemporaryFolder(); - /** Test data root path */ - private static final String testdataRoot = "src/test/resources/testdata/integrationtests/ProcessTemplateSetTest"; + /** + * Root path to all resources used in this test case + */ + private final static Path TEST_FILE_ROOT_PATH = Paths + .get("src/test/resources/testdata/integrationtests/ProcessTemplateSetTest"); @Test public void testGetAllTemplateSetsAdapted() throws Exception { @@ -58,15 +61,19 @@ public void testInstallTemplateSet() throws Exception { // simulate template-set-list folder for downloaded template-set.xml files to be used in GUI this.tmpFolder.newFolder("UserHome", "template-set-list"); - Path templateSetXmlFile = Paths.get(testdataRoot).resolve("crud-java-server-app-2021.12.007-template-set.xml"); + Path templateSetXmlFile = TEST_FILE_ROOT_PATH.resolve("crud-java-server-app-2021.12.007-template-set.xml"); + + // initialize template set reader + TemplateSetConfigurationReader reader = new TemplateSetConfigurationReader(); - TemplateSetArtifactReader artifactReader = new TemplateSetArtifactReader(); + // read template set xml file/files + reader.readConfiguration(templateSetXmlFile); - TemplateSet templateSet = artifactReader.retrieveTemplateSet(templateSetXmlFile); + TemplateSetConfiguration templateSetConfiguration = reader.getTemplateSetConfiguration(); - // adds template set to GUI + // pass TemplateSetConfiguration to GUI this.templateSetObservableList = FXCollections.observableArrayList(); - this.templateSetObservableList.addAll(templateSet); + this.templateSetObservableList.addAll(templateSetConfiguration); this.searchResultsView.setItems(this.templateSetObservableList); @@ -78,8 +85,7 @@ public void testInstallTemplateSet() throws Exception { withEnvironmentVariable(ConfigurationConstants.CONFIG_ENV_HOME, userHome.getAbsolutePath()).execute(() -> { // clicks on first element of searchResultsView - clickOn(this.searchResultsView.getItems().get(0).getTemplateSetConfiguration().getContextConfiguration() - .getTriggers().getId()); + clickOn(this.searchResultsView.getItems().get(0).getContextConfiguration().getTrigger().get(0).getId()); sleep(1000); diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TemplateSetDetailsTest.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TemplateSetDetailsTest.java index b9b3d8df53..81f218cee9 100644 --- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TemplateSetDetailsTest.java +++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TemplateSetDetailsTest.java @@ -7,8 +7,8 @@ import org.junit.Test; -import com.devonfw.cobigen.retriever.reader.TemplateSetArtifactReader; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; +import com.devonfw.cobigen.impl.config.reader.TemplateSetConfigurationReader; import javafx.collections.FXCollections; @@ -18,8 +18,11 @@ */ public class TemplateSetDetailsTest extends TestFXBase { - /** Test data root path */ - private static final String testdataRoot = "src/test/resources/testdata/unittests/TemplateSetDetailsTest"; + /** + * Root path to all resources used in this test case + */ + private final static Path TEST_FILE_ROOT_PATH = Paths + .get("src/test/resources/testdata/unittests/TemplateSetDetailsTest"); /** * @@ -47,22 +50,25 @@ public void testVisibilityAfterSearchAndSelect() { @Test public void testTemplateSetNameIsShownCorrectly() { - Path templateSetXmlFile = Paths.get(testdataRoot).resolve("template-set.xml"); + Path templateSetXmlFile = TEST_FILE_ROOT_PATH.resolve("template-set.xml"); + + // initialize template set reader + TemplateSetConfigurationReader reader = new TemplateSetConfigurationReader(); - // TODO replace with template set reader - TemplateSetArtifactReader artifactReader = new TemplateSetArtifactReader(); + // read template set xml file/files + reader.readConfiguration(templateSetXmlFile); - TemplateSet templateSet = artifactReader.retrieveTemplateSet(templateSetXmlFile); + TemplateSetConfiguration templateSetConfiguration = reader.getTemplateSetConfiguration(); // adds template set to GUI this.templateSetObservableList = FXCollections.observableArrayList(); - this.templateSetObservableList.addAll(templateSet); + this.templateSetObservableList.addAll(templateSetConfiguration); this.searchResultsView.setItems(this.templateSetObservableList); - String triggerName = templateSet.getTemplateSetConfiguration().getContextConfiguration().getTriggers().getId(); - String templateSetNameInMenu = this.searchResultsView.getItems().get(0).getTemplateSetConfiguration() - .getContextConfiguration().getTriggers().getId(); + String triggerName = templateSetConfiguration.getContextConfiguration().getTrigger().get(0).getId(); + String templateSetNameInMenu = this.searchResultsView.getItems().get(0).getContextConfiguration().getTrigger() + .get(0).getId(); assertThat(templateSetNameInMenu).isEqualTo(triggerName); } diff --git a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java index 453f77b1c3..b04a6fdb73 100644 --- a/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java +++ b/cobigen/gui/src/test/java/com/devonfw/cobigen/gui/TestFXBase.java @@ -10,7 +10,7 @@ import com.devonfw.cobigen.gui.controllers.DetailsController; import com.devonfw.cobigen.gui.controllers.MenuController; -import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; +import com.devonfw.cobigen.impl.config.entity.io.TemplateSetConfiguration; import javafx.collections.ObservableList; import javafx.fxml.FXMLLoader; @@ -45,9 +45,9 @@ public class TestFXBase extends ApplicationTest { DetailsController detailsController; - ListView searchResultsView; + ListView searchResultsView; - ObservableList templateSetObservableList; + ObservableList templateSetObservableList; protected static ResourceBundle bundle; diff --git a/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml index 56f898158a..c80976b27b 100644 --- a/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml +++ b/cobigen/gui/src/test/resources/testdata/integrationtests/ProcessTemplateSetTest/crud-java-server-app-2021.12.007-template-set.xml @@ -1,41 +1,39 @@ - - - - - - + - - - - - - - - + + + + + + + + - - - - - + + + + + + - - - + + + + + + + + + + + + + - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/cobigen/gui/src/test/resources/testdata/unittests/TemplateSetDetailsTest/template-set.xml b/cobigen/gui/src/test/resources/testdata/unittests/TemplateSetDetailsTest/template-set.xml index 56f898158a..c80976b27b 100644 --- a/cobigen/gui/src/test/resources/testdata/unittests/TemplateSetDetailsTest/template-set.xml +++ b/cobigen/gui/src/test/resources/testdata/unittests/TemplateSetDetailsTest/template-set.xml @@ -1,41 +1,39 @@ - - - - - - + - - - - - - - - + + + + + + + + - - - - - + + + + + + - - - + + + + + + + + + + + + + - - - - - - - - - - \ No newline at end of file + \ No newline at end of file