use of org.eclipse.reddeer.swt.api.TreeItem 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.api.TreeItem in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method setNewVariableValue.
// TODO this should be replaced once
// https://github.com/jboss-reddeer/reddeer/issues/1668 is fixed.
private void setNewVariableValue(String newValue, final String... variablePath) {
new WaitWhile(new JobIsRunning());
LaunchView debugView = new LaunchView();
debugView.open();
ensureCorrectFrameIsSelected(debugView);
VariablesView variablesView = new VariablesView();
variablesView.open();
new WaitUntil(new AbstractWaitCondition() {
@Override
public boolean test() {
try {
TreeItem variable = new DefaultTreeItem(variablePath);
variable.select();
return variable.isSelected();
} catch (Exception e) {
return false;
}
}
@Override
public String description() {
return "Variable is not selected";
}
}, TimePeriod.LONG);
try {
new ContextMenuItem("Change Value...").select();
} catch (CoreLayerException e) {
throw e;
}
new DefaultShell("Change Object Value");
new DefaultStyledText().setText(newValue);
new OkButton().click();
new WaitWhile(new JobIsRunning());
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class NodeJSAppDebugTest method testVariablesAvailableInView.
@Test
public void testVariablesAvailableInView() throws CoreException, IOException {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.getProject(OpenShiftResources.NODEJS_GIT_NAME).getProjectItem("server.js").open();
new WaitUntil(new EditorWithTitleIsActive("server.js"));
TextEditor editor = new TextEditor("server.js");
setLineBreakpoint(editor, BREAKPOINT_LINE);
triggerDebugSession();
// test couple of js variables
TreeItem var_db = getVariable(VAR_db);
TreeItem var_initDb = getVariable(VAR_initDb);
TreeItem var_require = getVariable(VAR_require);
assertTrue("Variable '" + VAR_db + "' not found in view!", var_db != null);
assertThat(var_db.getCell(0), is(VAR_db));
assertThat(var_db.getCell(1), containsString(VAR_VALUE_db));
assertTrue("Variable '" + VAR_initDb + "' not found in view!", var_initDb != null);
assertThat(var_initDb.getCell(0), is(VAR_initDb));
assertThat(var_initDb.getCell(1), containsString(VAR_VALUE_initDb));
assertTrue("Variable '" + VAR_require + "' not found in view!", var_require != null);
assertThat(var_require.getCell(0), is(VAR_require));
assertThat(var_require.getCell(1), containsString(VAR_VALUE_require));
}
use of org.eclipse.reddeer.swt.api.TreeItem 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);
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class ProjectPropertiesTest method getCurrentAnnotationProperties.
private List<TreeItem> getCurrentAnnotationProperties() {
try {
PropertySheetProperty annotationPropertiesRoot = propertiesView.getProperty("Annotations");
List<TreeItem> annotationProperties = annotationPropertiesRoot.getTreeItem().getItems();
assertTrue("There should be some annotation properties in the tab", annotationProperties != null && annotationProperties.size() > 0);
return annotationProperties;
} catch (CoreLayerException e) {
fail(e.getMessage());
return null;
}
}
Aggregations