use of org.jboss.tools.openshift.reddeer.exception.OpenShiftToolsException 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