use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method discover.
/**
* Overwriting of URL requires user confirmation, Message Dialog is shown. If
* url is not filled in, no dialog pops up and url is generated automatically.
* If it is not possible to get proper registry url (ie. adapter is stopped),
* then Error dialog is thrown.
*/
public void discover() {
Button discover = getDiscoveryButton();
discover.click();
try {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND), TimePeriod.DEFAULT);
// Error dialog appeared, exception will be thrown
log.error("Unable to discover a registry URL");
throw new OpenShiftToolsException(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND);
} catch (WaitTimeoutExpiredException exc) {
// Error dialog was not thrown
}
try {
confirmMessageDialog();
} catch (WaitTimeoutExpiredException exc) {
// Confirmation dialog did not appear, only spotted reason so far is that
// it would be replacing the same URL.
log.info("Discover action did not invoke any dialog");
}
}
use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method finish.
/**
* Waits and clicks Finish button .
*/
public void finish() {
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
// check for Wizard closing dialog
try {
new WaitUntil(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM);
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
new FinishButton().click();
} catch (WaitTimeoutExpiredException exc) {
// dialog not shown, continue
}
waitForShellToClose(getShell());
}
use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method executeImport.
private void executeImport(boolean importProject) {
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
if (!importProject) {
new CancelButton().click();
} else {
new FinishButton().click();
try {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.CHEATSHEET);
new CheckBox(0).click();
new NoButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET));
} catch (WaitTimeoutExpiredException ex) {
// do nothing if cheat sheet is not provided
}
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
}
use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method testDockerConnection.
/**
* Tests Docker connection
*
* @param dockerDaemon name of docker connection
*/
public void testDockerConnection(String dockerDaemon) {
DockerExplorerView dockerExplorer = new DockerExplorerView();
dockerExplorer.open();
DockerConnection connection = dockerExplorer.getDockerConnectionByName(dockerDaemon);
if (connection == null) {
// $NON-NLS-1$
fail("Could not find Docker connection " + dockerDaemon);
}
connection.select();
connection.enableConnection();
connection.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
try {
// $NON-NLS-1$
assertTrue("Docker connection does not contain any images", connection.getImagesNames().size() > 0);
} catch (WaitTimeoutExpiredException ex) {
ex.printStackTrace();
fail(// $NON-NLS-1$
"WaitTimeoutExpiredException occurs when expanding" + " Docker connection " + // $NON-NLS-1$
dockerDaemon);
} catch (JFaceLayerException jFaceExc) {
jFaceExc.printStackTrace();
fail(jFaceExc.getMessage());
}
dockerExplorer.close();
}
use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method testOpenshiftConnection.
/**
* Tests Openshift 3 connection and try to refresh it
*
* @param connection
*/
public void testOpenshiftConnection(String server, String username) {
OpenShift3Connection connection = null;
try {
connection = findOpenShiftConnection(server, username);
} catch (OpenShiftToolsException toolsExc) {
fail(toolsExc.getMessage());
}
// usually, when server adapter is not started, openshift connection after refresh should cause
// problem occurred dialog
connection.refresh();
try {
// $NON-NLS-1$
new WaitUntil(new ShellIsAvailable("Problem occurred"), TimePeriod.getCustom(30));
CDKUtils.captureScreenshot("CDKServerAdapterAbstractTest#testOpenshiftConnection");
new DefaultShell("Problem occurred").close();
// $NON-NLS-1$
fail("Problem dialog occured when refreshing OpenShift connection");
} catch (WaitTimeoutExpiredException ex) {
// no dialog appeared, which is ok
// $NON-NLS-1$
log.info("Expected WaitTimeoutExpiredException occured");
}
}
Aggregations