Search in sources :

Example 31 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method testDebuggerStopsAtBreakpoint.

@Test
public void testDebuggerStopsAtBreakpoint() throws CoreException, IOException {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    pe.getProject(OpenShiftResources.NODEJS_GIT_NAME).getProjectItem("server.js").open();
    new WaitUntil(new EditorWithTitleIsActive("server.js"));
    TextEditor editor = new TextEditor("server.js");
    setLineBreakpoint(editor, BREAKPOINT_LINE);
    triggerDebugSession();
    try {
        new WaitUntil(new EditorWithTitleIsActive("server.js"), TimePeriod.LONG);
        new WaitUntil(new CursorPositionIsOnLine(editor, BREAKPOINT_LINE));
    } catch (WaitTimeoutExpiredException e) {
        Assert.fail("Debugger hasn't stopped on breakpoint");
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) EditorWithTitleIsActive(org.eclipse.reddeer.workbench.condition.EditorWithTitleIsActive) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 32 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException 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)

Example 33 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class CDKServer method confirmSSLCertificateDialog.

/**
 * Methods waits for SSL Certificate dialog shell to appear and then confirms dialog,
 * it might happen that certificate is already in place and no dialog is shown,
 * then WaitTimeoutExpiredException is logged but not raised
 */
private void confirmSSLCertificateDialog(Shell shell) {
    try {
        DefaultShell certificateDialog = new DefaultShell(shell);
        certificateDialog.setFocus();
        log.info("SSL Certificate Dialog appeared during " + getLabel().getState().toString());
        new PushButton(certificateDialog, "Yes").click();
        new WaitWhile(new ShellIsAvailable(certificateDialog));
        setCertificateAccepted(true);
    } catch (WaitTimeoutExpiredException ex) {
        String message = "WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown";
        log.error(message);
        throw new CDKServerException(message, ex);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 34 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class CDKServer method checkInitialStateChange.

private void checkInitialStateChange(ServerState actualState) {
    try {
        new WaitUntil(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
        String message = "Server's state went back to " + actualState;
        throw new CDKServerException(message);
    } catch (WaitTimeoutExpiredException exc) {
        log.info("Server's state changed to " + this.getLabel().getState() + " and did not go back to " + actualState);
    }
}
Also used : ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 35 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.

the class NewServerContainerWizardPage method disposeSecureStoragePassword.

@SuppressWarnings("unused")
private static void disposeSecureStoragePassword() {
    try {
        new WaitUntil(new ShellIsAvailable(SECURE_STORAGE), TimePeriod.MEDIUM, true);
        new DefaultShell(SECURE_STORAGE).close();
        new WaitWhile(new ShellIsAvailable(SECURE_STORAGE));
    } catch (WaitTimeoutExpiredException exc) {
        log.info("WaitTimeoutExpiredException occurred while waiting for Secure Storage Password dialog");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)46 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)34 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)23 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)15 Test (org.junit.Test)12 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)10 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)10 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)6 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)5 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)5 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)4 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4