Skip to content

Commit

Permalink
devonfw#1518 Eclipse test correction
Browse files Browse the repository at this point in the history
  • Loading branch information
MansourD committed Aug 4, 2022
1 parent 7644fdf commit ffced32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -49,12 +48,6 @@ public class UpgradeMonolithicTemplatesTest extends SystemTest {
*
* @throws Exception
*/
@Before
public void setupTestIsolation() throws Exception {

this.currentHome = this.tempFolder.newFolder("cobigen-test-home").toPath();

}

/**
* Setup workbench appropriately for tests
Expand All @@ -81,6 +74,7 @@ public static void setupClass() throws Exception {
@Test
public void testUpgradeAndGenerateFromTextInput() throws Exception {

this.currentHome = this.tempFolder.newFolder("cobigen-test-home").toPath();
withEnvironmentVariable(ConfigurationConstants.CONFIG_ENV_HOME, this.currentHome.toString()).execute(() -> {

// create a new temporary java project and copy java class used as an input for CobiGen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ private static CobiGen initializeCobiGen(IProject generatorProj, boolean allowMo
Path templateSetsDownloadedFolderPath = templatesDirectoryPath.resolve(ConfigurationConstants.DOWNLOADED_FOLDER);

if (!ResourcesPluginUtil.generatorProjExists || ResourcesPluginUtil.TemplatesUpgraded) {

/*
* After the upgrade the new template-sets will be used. Only once! Then the old configuration has to be deleted
* or the upgrader will start again. This time the upgrader cannot start again because template-sets already
* exists.
*/
ResourcesPluginUtil.TemplatesUpgraded = false;
// check adapted and downloaded folder
if (Files.exists(templateSetsAdaptedFolderPath) || Files.exists(templateSetsDownloadedFolderPath)) {
return CobiGenFactory.create(templatesDirectoryPath.toUri(), allowMonolithicConfiguration);
Expand Down

0 comments on commit ffced32

Please sign in to comment.