}
public void testStepAttributeLink() throws Exception {
cEditor = openFileInEditor("src/batch-config.xml");
final AbstractConfigFormPage page = cEditor.getFormPageForUri(BatchSchemaConstants.URI);
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
cEditor.setActivePage(page.getId());
assertNotNull("Could not load batch page.", page.getMasterPart());
TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
treeViewer.expandAll();
TreeItem root = treeViewer.getTree().getItem(0);
TreeItem item = root.getItem(0).getItem(0);
IDOMElement selection = (IDOMElement) item.getData();
page.setSelection(new StructuredSelection(selection));
assertEquals("step1", selection.getAttribute(BatchSchemaConstants.ATTR_ID));
}
});
bot.hyperlink(BatchSchemaConstants.ATTR_NEXT.concat(":")).click();
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
TreeItem[] items = treeViewer.getTree().getSelection();
IDOMElement selection = (IDOMElement) items[0].getData();
assertEquals(BatchSchemaConstants.ELEM_STEP, selection.getLocalName());
assertEquals("step2", selection.getAttribute(BatchSchemaConstants.ATTR_ID));
}