Search in sources :

Example 1 with CDKServerException

use of org.jboss.tools.cdk.reddeer.server.exception.CDKServerException in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method addCDKServer.

public void addCDKServer() {
    NewCDKServerWizard dialog = CDKTestUtils.openNewServerWizardDialog();
    try {
        setupServerWizardPage(dialog);
        new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
        dialog.finish(TimePeriod.MEDIUM);
    } catch (RedDeerException coreExc) {
        new CancelButton().click();
        throw new CDKServerException("Exception occured in CDK server wizard, wizard was canceled", coreExc);
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 2 with CDKServerException

use of org.jboss.tools.cdk.reddeer.server.exception.CDKServerException 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 3 with CDKServerException

use of org.jboss.tools.cdk.reddeer.server.exception.CDKServerException in project jbosstools-openshift by jbosstools.

the class CDKServer method processProblemDialog.

private void processProblemDialog(Shell shell, String excMessage) {
    log.info("Processing passed shell dialog " + new DefaultShell(shell).getText());
    new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
    DefaultShell shellDialog = new DefaultShell(shell);
    log.info("Shell could have changed after getting another error");
    log.info("Actual shell dialog name is " + shellDialog.getText());
    CDKUtils.captureScreenshot("CDEServer#ProblemDialog#" + shellDialog.getText());
    new OkButton(shellDialog).click();
    throw new CDKServerException(excMessage);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 4 with CDKServerException

use of org.jboss.tools.cdk.reddeer.server.exception.CDKServerException 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)

Aggregations

CDKServerException (org.jboss.tools.cdk.reddeer.server.exception.CDKServerException)4 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 ServerHasState (org.eclipse.reddeer.eclipse.condition.ServerHasState)1 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)1 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 SystemJobIsRunning (org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning)1 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)1