use of org.eclipse.reddeer.jface.exception.JFaceLayerException in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method removeAccessRedHatCredentials.
// removes access redhat com credentials used for first cdk run
public static void removeAccessRedHatCredentials(String domain, String username) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
dialog.open();
// $NON-NLS-1$ //$NON-NLS-2$
dialog.select("JBoss Tools", "Credentials");
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Credentials")), // $NON-NLS-1$
TimePeriod.MEDIUM);
// $NON-NLS-1$
new DefaultCLabel("Credentials");
DefaultTree tree = new DefaultTree(1);
TreeItem item = TreeViewerHandler.getInstance().getTreeItem(tree, new String[] { domain, username });
item.select();
// $NON-NLS-1$
new PushButton(new WithTextMatcher("Remove User")).click();
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (WaitTimeoutExpiredException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials preferences page has timed out");
exc.printStackTrace();
} catch (JFaceLayerException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials does not contain required username to be deleted");
exc.printStackTrace();
} finally {
dialog.ok();
}
}
use of org.eclipse.reddeer.jface.exception.JFaceLayerException 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();
}
Aggregations