diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java index 7eff036a..bd420222 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java @@ -122,29 +122,18 @@ protected static void cleanupProject(String projectPathStr) { * @throws InterruptedException * @throws CoreException */ - public static void importMavenProjects(File workspaceRoot, List folders) { - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - try { - // Get the list of projects to install. - MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); - LocalProjectScanner lps = new LocalProjectScanner(folders, false, modelManager); - lps.run(new NullProgressMonitor()); - List projects = lps.getProjects(); - - // Import the projects. - ProjectImportConfiguration projectImportConfig = new ProjectImportConfiguration(); - IProjectConfigurationManager projectConfigurationManager = MavenPlugin.getProjectConfigurationManager(); - projectConfigurationManager.importProjects(projects, projectImportConfig, new NullProgressMonitor()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - }); + public static void importMavenProjects(File workspaceRoot, List folders) throws Exception { + + // Get the list of projects to install. + MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); + LocalProjectScanner lps = new LocalProjectScanner(folders, false, modelManager); + lps.run(new NullProgressMonitor()); + List projects = lps.getProjects(); + + // Import the projects. + ProjectImportConfiguration projectImportConfig = new ProjectImportConfiguration(); + IProjectConfigurationManager projectConfigurationManager = MavenPlugin.getProjectConfigurationManager(); + projectConfigurationManager.importProjects(projects, projectImportConfig, new NullProgressMonitor()); } /** @@ -155,26 +144,16 @@ public void run() { * @throws InterruptedException * @throws CoreException */ - public static void importGradleApplications(ArrayList projectsToInstall) { - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - try { - for (File projectFile : projectsToInstall) { - IPath projectLocation = org.eclipse.core.runtime.Path - .fromOSString(Paths.get(projectFile.getPath()).toAbsolutePath().toString()); - BuildConfiguration configuration = BuildConfiguration.forRootProjectDirectory(projectLocation.toFile()).build(); - GradleWorkspace workspace = GradleCore.getWorkspace(); - GradleBuild newBuild = workspace.createBuild(configuration); - newBuild.synchronize(new NullProgressMonitor()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - }); + public static void importGradleApplications(ArrayList projectsToInstall) throws Exception { + + for (File projectFile : projectsToInstall) { + IPath projectLocation = org.eclipse.core.runtime.Path + .fromOSString(Paths.get(projectFile.getPath()).toAbsolutePath().toString()); + BuildConfiguration configuration = BuildConfiguration.forRootProjectDirectory(projectLocation.toFile()).build(); + GradleWorkspace workspace = GradleCore.getWorkspace(); + GradleBuild newBuild = workspace.createBuild(configuration); + newBuild.synchronize(new NullProgressMonitor()); + } } /** @@ -199,4 +178,4 @@ public void validateRemoteJavaAppCreation(String projectName) { Assertions.fail("The remote java application configuration did not contain project name " + projectName); } -} \ No newline at end of file +}