use of org.eclipse.reddeer.swt.impl.tree.DefaultTree 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.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method getSuspendedThreadTreeItem.
private TreeItem getSuspendedThreadTreeItem(LaunchView debugView) {
// get top item
debugView.activate();
DefaultTree parent = new DefaultTree();
TreeItem remoteDebuggerTreeItem = parent.getItems().stream().filter(containsStringPredicate("Remote debugger")).findFirst().get();
List<TreeItem> items = remoteDebuggerTreeItem.getItems();
TreeItem openJDKTreeItem = items.get(0);
// this could (and will) change when run with another JDK - need
// investigation
assertTrue(openJDKTreeItem.getText().contains("OpenJDK"));
// wait until we can see the suspended thread
SuspendedTreeItemIsReady suspendedTreeItemIsReady = new SuspendedTreeItemIsReady(openJDKTreeItem);
new WaitUntil(suspendedTreeItemIsReady, TimePeriod.VERY_LONG);
return suspendedTreeItemIsReady.getSuspendedTreeItem();
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method selectServerTemplate.
private void selectServerTemplate(String templateName) {
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
new WaitUntil(new TreeIsAvailable());
new DefaultTree().selectItems(new DefaultTreeItem(templateName));
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method testAccessibilityOfDefinedResourcesButton.
@Test(expected = OpenshiftTestInFailureException.class)
public void testAccessibilityOfDefinedResourcesButton() {
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
assertDefinedResourcesButtonIsNotPresent();
new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
assertDefinedResourcesButtonIsNotPresent();
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
OpenShiftUtils.selectEAPTemplate();
assertTrue("Defines Resources button should be enabled if a server template is selected.", new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
assertDefinedResourcesButtonIsNotPresent();
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
new DefaultTree().unselectAllItems();
new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
Display.syncExec(new Runnable() {
@Override
public void run() {
new DefaultText(1).getSWTWidget().setText(DatastoreOS3.TEMPLATE_PATH);
}
});
try {
assertTrue("Defines Resources button should be enabled if a local template is selected.", new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
} catch (CoreLayerException ex) {
throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
}
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
assertDefinedResourcesButtonIsNotPresent();
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method verifyDefinedResourcesForTemplate.
private void verifyDefinedResourcesForTemplate() {
try {
new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES)), TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException ex) {
fail("Defined Resources button is not enabled");
} catch (CoreLayerException ex) {
// Defined resources button was not found
throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
}
new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).click();
new DefaultShell(OpenShiftLabel.Shell.TEMPLATE_DETAILS);
List<TreeItem> items = new DefaultTree().getItems();
assertTrue("There should be build config item in tree describing resources", items.get(0).getText().contains("BuildConfig"));
assertTrue("There should be deployment config item in tree describing resources", items.get(1).getText().contains("DeploymentConfig"));
assertTrue("There should be image stream item in tree describing resources", items.get(2).getText().contains("ImageStream"));
assertTrue("There should be route item in tree describing resources", items.get(3).getText().contains("Route"));
assertTrue("There should be service item in tree describing resources", items.get(4).getText().contains("Service"));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.TEMPLATE_DETAILS), TimePeriod.DEFAULT);
}
Aggregations