Search in sources :

Example 26 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class DockerContainer method remove.

public void remove() {
    select();
    boolean removeEnabled = new ContextMenu().getItem("Remove").isEnabled();
    if (!removeEnabled) {
        new ContextMenu().getItem("Stop").select();
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
        item.select();
    }
    new ContextMenu().getItem("Remove").select();
    new WaitUntil(new ShellIsAvailable("Confirm Remove Container"), TimePeriod.DEFAULT);
    new PushButton("OK").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 27 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method run.

/**
 * Executes configuration
 */
public void run() {
    new PushButton(this, "Run").click();
    new WaitWhile(new ShellIsAvailable(this));
    new WaitUntil(new JobIsRunning());
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
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) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 28 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method close.

/**
 * Presses Close button on the Dialog.
 */
public void close() {
    new PushButton(this, "Close").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)

Example 29 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.

the class JPAProjectFactory method createProject.

/**
 * Creates JPA Project
 * @param prj projec name
 * @param version JPA version
 * @param platform JPA platform
 */
public static void createProject(String prj, String version, String platform) {
    log.step("Open JPA Project Wizard");
    JPAProjectWizard wizard = new JPAProjectWizard();
    wizard.open();
    JPAProjectWizardFirstPage firstPage = new JPAProjectWizardFirstPage(wizard);
    firstPage.setProjectName(prj);
    firstPage.setJPAVersion(version);
    wizard.next();
    wizard.next();
    log.step("Disable hibernate configuration");
    JpaFacetInstallPage facetPage = new JpaFacetInstallPage(wizard);
    facetPage.setPlatform(platform);
    facetPage.setJpaImplementation("Disable Library Configuration");
    log.step("Click finish");
    wizard.finish();
    new WaitWhile(new JobIsRunning());
    ProblemsView problemsView = new ProblemsView();
    problemsView.open();
    List<Problem> allErrors = problemsView.getProblems(ProblemType.ERROR);
    problemsView.open();
    assertTrue("No problems are expected (JBIDE-17855)", allErrors.size() == 0);
}
Also used : JPAProjectWizard(org.jboss.tools.hibernate.reddeer.wizard.JPAProjectWizard) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JPAProjectWizardFirstPage(org.jboss.tools.hibernate.reddeer.wizard.JPAProjectWizardFirstPage) JpaFacetInstallPage(org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage) Problem(org.eclipse.reddeer.eclipse.ui.problems.Problem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ProblemsView(org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView)

Example 30 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method setProjectFacetForDB.

/**
 * Sets JPA project facets for given database configuration
 * @param prj given project
 * @param cfg given database configuration
 * @param jpaVersion JPA version (2.0 or 2.1 is supported)
 */
public static void setProjectFacetForDB(String prj, DatabaseConfiguration cfg, String jpaVersion) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    boolean javaFacet = false;
    FacetsPropertyPage pp = new FacetsPropertyPage(pd);
    pd.select(pp);
    for (TreeItem t : getFacets(pd.getShell())) {
        if (t.getText().equals("Java")) {
            javaFacet = true;
            break;
        }
    }
    if (!javaFacet) {
        pp.selectFacet("Java");
        DefaultHyperlink hyperlink = new DefaultHyperlink();
        hyperlink.activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    pp.selectFacet("JPA");
    pp.selectVersion("JPA", jpaVersion);
    addFurtherJPAConfiguration(jpaVersion, !javaFacet);
    closePreferences(pd);
    new WorkbenchShell().setFocus();
    pe.open();
    pe.selectProjects(prj);
    pd.open();
    // TODO Why this takes so long ?
    pd.select("JPA");
    JpaFacetInstallPage jpaPage = new JpaFacetInstallPage(pd);
    jpaPage.setConnectionProfile(cfg.getProfileName());
    jpaPage.setAutoDiscovery(true);
    closePreferences(pd);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    checkPersistenceXML(prj);
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) FacetsPropertyPage(org.eclipse.reddeer.eclipse.wst.common.project.facet.ui.FacetsPropertyPage) JpaFacetInstallPage(org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage)

Aggregations

JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)154 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)142 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)62 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)52 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)46 Test (org.junit.Test)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)31 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)29 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)28 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)23 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)18 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)14 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)14 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)13 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10