use of org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method checkDebugView.
private void checkDebugView() {
LaunchView debugView = new LaunchView();
debugView.open();
TreeItem createHelloMessageDebugItem = ensureCorrectFrameIsSelected(debugView);
assertTrue(createHelloMessageDebugItem.getText().contains("createHelloMessage"));
}
use of org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method ensureCorrectFrameIsSelected.
private TreeItem ensureCorrectFrameIsSelected(LaunchView debugView) {
List<TreeItem> items;
TreeItem createHelloMessageDebugItem;
// get frames of suspended thread. If the desired frame is not present,
// try reopening Debug view
items = getSuspendedThreadTreeItem(debugView).getItems();
if (items.size() < 2) {
// no stack trace available. Try to close&reopen Debug view (dirty
// hack)
debugView.close();
debugView = new LaunchView();
debugView.open();
items = getSuspendedThreadTreeItem(debugView).getItems();
}
final List<TreeItem> tIList = items;
// wait for frame texts to populate.
new WaitUntil(new AbstractWaitCondition() {
@Override
public boolean test() {
return tIList.stream().peek(ti -> LOGGER.debug(ti.getText())).filter(ti -> ti.getText().contains("createHelloMessage")).findFirst().isPresent();
}
}, TimePeriod.LONG);
createHelloMessageDebugItem = tIList.stream().peek(ti -> LOGGER.debug(ti.getText())).filter(ti -> ti.getText().contains("createHelloMessage")).findFirst().get();
// select the item and return it
createHelloMessageDebugItem.select();
return createHelloMessageDebugItem;
}
use of org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView 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());
}
Aggregations