Search in sources :

Example 1 with JobIsKilled

use of org.eclipse.reddeer.workbench.core.condition.JobIsKilled in project jbosstools-openshift by jbosstools.

the class ServerAdapterWizardHandlingTest method openNewServerAdapterWizard.

private void openNewServerAdapterWizard() {
    NewServerWizard dialog = new NewServerWizard();
    dialog.open();
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    dialog.open();
    new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    page.selectType(OpenShiftLabel.Others.OS3_SERVER_ADAPTER);
    dialog.next();
}
Also used : NewServerWizard(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizard) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)

Example 2 with JobIsKilled

use of org.eclipse.reddeer.workbench.core.condition.JobIsKilled in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method finishNewServerAdapterWizardAndVerifyExistence.

public void finishNewServerAdapterWizardAndVerifyExistence() {
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.ADAPTER));
    boolean jobExists = false;
    try {
        new WaitUntil(new JobIsRunning(new StringContains(JOB_NAME)), TimePeriod.getCustom(5));
        jobExists = true;
    } catch (WaitTimeoutExpiredException e) {
    // job is not running, do nothing
    }
    if (jobExists) {
        new WaitUntil(new JobIsKilled(JOB_NAME), TimePeriod.VERY_LONG);
    }
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) StringContains(org.hamcrest.core.StringContains)

Example 3 with JobIsKilled

use of org.eclipse.reddeer.workbench.core.condition.JobIsKilled in project jbosstools-openshift by jbosstools.

the class NewCDKServerWizard method cancel.

@Override
public void cancel() {
    try {
        // wait for job to start
        new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM);
        // job has started - try to kill it
        new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    } catch (WaitTimeoutExpiredException exc) {
    // do nothing because job did not start
    }
    super.cancel();
}
Also used : WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 4 with JobIsKilled

use of org.eclipse.reddeer.workbench.core.condition.JobIsKilled in project jbosstools-openshift by jbosstools.

the class Service method createServerAdapter.

/**
 * Creates server adapter for this service with default values.
 */
public void createServerAdapter() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS));
    new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 5 with JobIsKilled

use of org.eclipse.reddeer.workbench.core.condition.JobIsKilled in project jbosstools-openshift by jbosstools.

the class NewCDKServerWizard method finish.

@Override
public void finish(TimePeriod timeout) {
    // workaround
    try {
        // wait for job to start
        new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM);
        // job has started - try to kill it
        new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    } catch (WaitTimeoutExpiredException exc) {
    // do nothing because job did not start
    }
    super.finish(timeout);
}
Also used : WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 JobIsKilled (org.eclipse.reddeer.workbench.core.condition.JobIsKilled)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)3 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2 NewServerWizard (org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizard)1 NewServerWizardPage (org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 StringContains (org.hamcrest.core.StringContains)1 ServerAdapterExists (org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists)1