Search in sources :

Example 86 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton 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
}
Also used : Path(java.nio.file.Path) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) MavenImportWizard(org.eclipse.reddeer.eclipse.m2e.core.ui.wizard.MavenImportWizard) FileVisitResult(java.nio.file.FileVisitResult) IOException(java.io.IOException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) File(java.io.File) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes)

Example 87 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-hibernate by jbosstools.

the class TableFilterWizardPage method refreshDatabaseSchema.

/**
 * Refreshes database schema
 */
public void refreshDatabaseSchema() {
    new PushButton(referencedComposite, "Refresh").click();
    DefaultGroup group = new DefaultGroup(referencedComposite, "Database schema:");
    DefaultTree tree = new DefaultTree(group);
    new WaitUntil(new TreeHasChildren(tree));
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup) TreeHasChildren(org.eclipse.reddeer.swt.condition.TreeHasChildren) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 88 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method setRevengFile.

/**
 * Select reveng file
 * @param path path to existing reveng file
 */
public void setRevengFile(String... path) {
    new PushButton(this, "Setup...").click();
    org.eclipse.reddeer.swt.api.Shell setupShell = new DefaultShell("Setup reverse engineering");
    new PushButton(setupShell, "Use existing...").click();
    org.eclipse.reddeer.swt.api.Shell selectShell = new DefaultShell("Select reverse engineering settings file");
    new DefaultTreeItem(new DefaultTree(selectShell), path).select();
    new OkButton(selectShell).click();
    new WaitWhile(new ShellIsAvailable(selectShell));
    new WaitWhile(new ShellIsAvailable(setupShell));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 89 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method apply.

/**
 * Click apply
 */
public void apply() {
    new PushButton(this, "Apply").click();
    new WaitWhile(new JobIsRunning());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 90 with PushButton

use of org.eclipse.reddeer.swt.impl.button.PushButton in project jbosstools-hibernate by jbosstools.

the class EditConfigurationShell method ok.

/**
 * Click ok on Hibernate Configuration Console shell
 */
public void ok() {
    new PushButton(this, "OK").click();
    new WaitWhile(new ShellIsAvailable(this));
    new WaitWhile(new JobIsRunning());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)94 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)49 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)43 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)41 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)38 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)38 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)34 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)28 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)20 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 Test (org.junit.Test)16 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)15 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)6 Button (org.eclipse.reddeer.swt.api.Button)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6