use of org.eclipse.reddeer.eclipse.m2e.core.ui.wizard.MavenImportWizard in project jbosstools-hibernate by jbosstools.
the class HibernateRedDeerTest method importMavenProject.
public static void importMavenProject(String prjName) {
try {
Path sourceFolder = new File("resources/prj/" + prjName).toPath();
File dir = new File("target/" + prjName);
if (dir.exists()) {
deleteDir(dir);
}
Path destFolder = dir.toPath();
Files.walkFileTree(sourceFolder, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException {
Files.createDirectories(destFolder.resolve(sourceFolder.relativize(dir)));
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
Files.copy(file, destFolder.resolve(sourceFolder.relativize(file)));
return FileVisitResult.CONTINUE;
}
});
MavenImportWizard wizard = new MavenImportWizard();
wizard.open();
wizard.getWizardPage().setRootDirectory("target/" + prjName);
wizard.getWizardPage().refresh();
wizard.getWizardPage().waitUntilProjectIsLoaded(TimePeriod.LONG);
Shell shell = new DefaultShell("Import Maven Projects");
new PushButton("Finish").click();
new WaitWhile(new ShellIsAvailable(shell), TimePeriod.DEFAULT);
new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
} catch (IOException e) {
fail("Unable to find pom " + prjName);
}
// TODO check error log for errors
}
Aggregations