use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class CDKServer method operateServerState.
@Override
protected void operateServerState(String menuItem, final ServerState resultState) {
ServerState actualState = this.getLabel().getState();
MultipleWaitConditionHandler waitConditions = new MultipleWaitConditionHandler(waitConditionMatrix, " one of given wait condition is fulfilled");
TimePeriod timeout = TimePeriod.VERY_LONG;
if (menuItem == "Restart") {
timeout = TimePeriod.getCustom(480);
}
log.debug("Operate server's state from: + '" + actualState + "' to '" + menuItem + "'");
select();
new ContextMenuItem(menuItem).select();
// waiting until servers's state has changed from initial state into something else,
// ie. stopped -> starting or started -> stopping
new WaitWhile(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
// we might expect that after the state is changed it should not go back into initial state
// or that problem dialog appears
// later on, we might get "Multiple problems have occurred" dialog
waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
checkInitialStateChange(actualState);
// decide if we wait for SSL acceptance dialog
if ((actualState == ServerState.STOPPING || actualState == ServerState.STOPPED) && !getCertificatedAccepted()) {
new WaitUntil(waitConditions, TimePeriod.getCustom(1020));
}
new WaitUntil(new ServerHasState(this, resultState), timeout);
waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
new WaitWhile(new SystemJobIsRunning(new JobMatcher("Inspecting CDK environment")), TimePeriod.DEFAULT);
log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class DisableSecureStorageRequirement method setSecureStorageMasterPasswords.
private void setSecureStorageMasterPasswords(boolean checked) {
WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
StoragePreferencePage storagePage = new StoragePreferencePage(preferenceDialog);
preferenceDialog.open();
preferenceDialog.select(storagePage);
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Secure Storage")), TimePeriod.DEFAULT);
log.info("Getting master password providers");
List<PasswordProvider> items = storagePage.getMasterPasswordProviders();
for (PasswordProvider item : items) {
log.info("Uncheking table item: " + item.getDescription());
item.setEnabled(checked);
}
new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
storagePage.apply();
} catch (WaitTimeoutExpiredException exc) {
log.error("Secure Storage preferences page has timed out");
log.error(exc.getMessage());
} finally {
preferenceDialog.ok();
}
}
use of org.eclipse.reddeer.common.wait.WaitUntil 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();
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class MinishiftServerEditor method openLaunchConfigurationFromLink.
public void openLaunchConfigurationFromLink() {
log.info("Activate launch configuration via link");
getLaunchConfigurationHyperLink().activate();
ShellIsAvailable launch = new ShellIsAvailable("Edit Configuration");
try {
new WaitUntil(launch, TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException exc) {
log.error("WaitTimeoutExpiredException occured while waiting for Edit Configuration dialog");
}
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class CDKServerEditorAbstractTest method errorDialogAppeared.
private void errorDialogAppeared() {
try {
new WaitUntil(new ShellIsAvailable(new DefaultShell(getServerAdapter())), TimePeriod.MEDIUM);
log.info("Error Message Dialog appeared as expected");
} catch (WaitTimeoutExpiredException exc) {
log.error(exc.getMessage());
fail("Error Message Dialog did not appear while trying to save editor");
}
new OkButton().click();
}
Aggregations