From 3f1f30f1dce18d1d0b5c47183019a82e3b4a0646 Mon Sep 17 00:00:00 2001 From: MansourD Date: Wed, 6 Jul 2022 11:59:40 +0200 Subject: [PATCH] #1518 --- .../cli/commands/AdaptTemplatesCommand.java | 2 +- .../test/GenerateFromTextInputTest.java | 2 -- .../common/utils/EclipseCobiGenUtils.java | 23 ++----------------- .../templates/src/main/templates/context.xml | 2 +- .../versioning/VersionValidatorTest.java | 2 -- 5 files changed, 4 insertions(+), 27 deletions(-) diff --git a/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/AdaptTemplatesCommand.java b/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/AdaptTemplatesCommand.java index f0d1a9c573..05e474a6a9 100644 --- a/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/AdaptTemplatesCommand.java +++ b/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/AdaptTemplatesCommand.java @@ -51,7 +51,7 @@ public Integer doAction() throws Exception { templateAdapter.adaptTemplates(); } catch (UpgradeTemplatesNotificationException e) { if (askUserToContinueWithUpgrade(e)) { - templateAdapter.upgradeMonolithicTemplates(); + TemplateAdapter.upgradeMonolithicTemplates(); } } catch (TemplateSelectionForAdaptionException e) { List templateJars = e.getTemplateSets(); diff --git a/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/GenerateFromTextInputTest.java b/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/GenerateFromTextInputTest.java index 1819daa929..491c90a2a3 100644 --- a/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/GenerateFromTextInputTest.java +++ b/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/GenerateFromTextInputTest.java @@ -15,7 +15,6 @@ import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -55,7 +54,6 @@ public static void setupClass() throws Exception { * * @throws Exception Test fails */ - @Ignore @Test public void testGenerateFromTextDoesNotLoop() throws Exception { diff --git a/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/common/utils/EclipseCobiGenUtils.java b/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/common/utils/EclipseCobiGenUtils.java index fe255638ec..e6be62c722 100644 --- a/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/common/utils/EclipseCobiGenUtils.java +++ b/cobigen-eclipse/cobigen-eclipse-test/src/main/java/com/devonfw/cobigen/eclipse/test/common/utils/EclipseCobiGenUtils.java @@ -150,6 +150,7 @@ public static void processCobiGenWithTextInput(SWTWorkbenchBot bot, SWTBotEclips ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor()); bot.waitUntil(new AllJobsAreFinished(), defaultTimeout); // build might take some time input.contextMenu("CobiGen").menu("Generate...").click(); + postponeUpgradeAndContinue(bot); generateWithSelectedIncrements(bot, defaultTimeout, increments); } @@ -201,27 +202,7 @@ private static void processCobiGenAndPostponeUpgrade(SWTWorkbenchBot bot, SWTBot bot.waitUntil(new AllJobsAreFinished(), defaultTimeout); // build might take some time input.contextMenu("CobiGen").menu("Generate...").click(); postponeUpgradeAndContinue(bot); - bot.waitUntil(new AnyShellIsActive(CobiGenDialogConstants.GenerateWizard.DIALOG_TITLE, - CobiGenDialogConstants.GenerateWizard.DIALOG_TITLE_BATCH), defaultTimeout); - - // select increment and generate - for (String increment : increments) { - // check for multi layer nodes - if (increment.contains(">")) { - SWTBotTreeItem treeItem = expandNodes(bot, increment); - bot.waitUntil(widgetIsEnabled(treeItem)); - treeItem.check(); - } else { - // select single increment - SWTBotTreeItem treeItem = bot.tree().getTreeItem(increment); - bot.waitUntil(widgetIsEnabled(treeItem)); - treeItem.check(); - } - } - SWTBotButton finishButton = bot.button(IDialogConstants.FINISH_LABEL); - bot.waitUntil(widgetIsEnabled(bot.button())); - finishButton.click(); - + generateWithSelectedIncrements(bot, defaultTimeout, increments); } /** diff --git a/cobigen-eclipse/cobigen-eclipse-test/src/main/resources/GenerateFromTextInputTest/templates/src/main/templates/context.xml b/cobigen-eclipse/cobigen-eclipse-test/src/main/resources/GenerateFromTextInputTest/templates/src/main/templates/context.xml index b5774d7a5d..caa323e573 100644 --- a/cobigen-eclipse/cobigen-eclipse-test/src/main/resources/GenerateFromTextInputTest/templates/src/main/templates/context.xml +++ b/cobigen-eclipse/cobigen-eclipse-test/src/main/resources/GenerateFromTextInputTest/templates/src/main/templates/context.xml @@ -1,6 +1,6 @@ - + diff --git a/cobigen/cobigen-core/src/test/java/com/devonfw/cobigen/unittest/versioning/VersionValidatorTest.java b/cobigen/cobigen-core/src/test/java/com/devonfw/cobigen/unittest/versioning/VersionValidatorTest.java index ba8e6b106f..6faa4d9c7c 100644 --- a/cobigen/cobigen-core/src/test/java/com/devonfw/cobigen/unittest/versioning/VersionValidatorTest.java +++ b/cobigen/cobigen-core/src/test/java/com/devonfw/cobigen/unittest/versioning/VersionValidatorTest.java @@ -2,7 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Ignore; import org.junit.Test; import com.devonfw.cobigen.api.exception.InvalidConfigurationException; @@ -40,7 +39,6 @@ public void testInvalidCobiGenVersion_tooOld_contextConfiguration() { * * @author mbrunnli (May 17, 2016) */ - @Ignore // Should be reactivated after issue #1531 @Test(expected = InvalidConfigurationException.class) public void testInvalidCobiGenVersion_tooNew_contextConfiguration() {