From fec9bb19c0cf8f9286100bff4bea1439e99f3c5b Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 16 Oct 2024 13:31:56 +0200 Subject: [PATCH] Changed quarkus project location due to updates in test-library 0.4.2 Signed-off-by: Oleksii Korniienko --- .../intellij/quarkus/tests/BasicTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java b/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java index 3d59e1467..6e2dc119c 100644 --- a/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java +++ b/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java @@ -37,6 +37,12 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.time.Duration; import static com.intellij.remoterobot.search.locators.Locators.byXpath; @@ -115,6 +121,20 @@ private void createQuarkusProject(RemoteRobot remoteRobot, String projectName, B QuarkusNewProjectFinalPage quarkusNewProjectFinalPage = newProjectDialogWizard.find(QuarkusNewProjectFinalPage.class, Duration.ofSeconds(10)); quarkusNewProjectFinalPage.setProjectName(projectName); + + String QUARKUS_PROJECT_LOCATION = CreateCloseUtils.PROJECT_LOCATION + File.separator + projectName; + Path quarkusProjectDir = Paths.get(QUARKUS_PROJECT_LOCATION); + boolean doesProjectDirExists = Files.exists(quarkusProjectDir); + if (!doesProjectDirExists) { + try { + Files.createDirectories(quarkusProjectDir); // create project directory with project name to prevent "Directory does not exist. It will be created by Intellij. Create/Cancel" popup + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + quarkusNewProjectFinalPage.setProjectLocation(QUARKUS_PROJECT_LOCATION); + newProjectDialogWizard.finish(); minimizeProjectImportPopupIfItAppears();