use of org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem in project jbosstools-hibernate by jbosstools.
the class ConnectionProfileFactory method deleteAllConnectionProfiles.
/**
* Method deletes all connection profiles via Data Source Explorer
*/
public static void deleteAllConnectionProfiles() {
DataSourceExplorerView dse = new DataSourceExplorerView();
dse.open();
List<TreeItem> items = new DefaultTreeItem("Database Connections").getItems();
for (TreeItem i : items) {
i.select();
new ContextMenuItem("Delete").select();
;
Shell delete = new DefaultShell("Delete confirmation");
new YesButton(delete).click();
new WaitWhile(new ShellIsAvailable(delete));
}
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem in project jbosstools-openshift by jbosstools.
the class ServerAdapterWizardHandlingTest method testApplicationSelectionWidgetAccessibility.
@Test
public void testApplicationSelectionWidgetAccessibility() {
openNewServerAdapterWizard();
next();
new DefaultTreeItem(projectReq.getProjectName()).select();
assertFalse("Next button should be disable if no application is selected.", nextButtonIsEnabled());
new DefaultTreeItem(projectReq.getProjectName()).getItems().get(0).select();
assertTrue("Next button should be enabled if application for a new server adapter is created.", nextButtonIsEnabled());
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem in project jbosstools-openshift by jbosstools.
the class ServerAdapterFromResourceTest method newAdapterFromResource.
private void newAdapterFromResource(Resource type, String name) {
project.refresh();
project.getOpenShiftResource(type, name).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
String resourceType = null;
String selectors = name + " name=" + name;
if (type.equals(Resource.DEPLOYMENT)) {
resourceType = "ReplicationController";
selectors = name + " deploymentconfig=" + serviceReq.getService().getName() + ", name=" + serviceReq.getService().getName() + ", deployment=" + name;
} else {
resourceType = type.toString().replaceFirst(".$", "").replaceAll(" ", "");
}
assertTrue("Resource should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(project.getName(), selectors).isSelected());
try {
new DefaultStyledText(resourceType);
} catch (RedDeerException e) {
fail("Resource type does not match");
}
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(""));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, name, resourceType).test());
adapter = new ServerAdapter(Version.OPENSHIFT3, name, resourceType);
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertServerType.
protected void assertServerType(final String serverType) {
NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
try {
TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
item.select();
assertTrue(item.getText().equalsIgnoreCase(serverType));
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (CoreLayerException coreExp) {
log.error(coreExp.getMessage());
fail("Server type " + serverType + " was not found in New Server Wizard");
}
assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
try {
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new CancelButton().click();
} catch (WaitTimeoutExpiredException exc) {
exc.printStackTrace();
log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
new DefaultShell("New Server").close();
}
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem in project jbosstools-openshift by jbosstools.
the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaServersView.
@Test
public void testCreateOpenShift3ServerAdapterViaServersView() {
ServersView2 serversView = new ServersView2();
serversView.open();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_SERVER).select();
new DefaultShell(OpenShiftLabel.Shell.ADAPTER);
new DefaultTreeItem(OpenShiftLabel.Others.OS3_SERVER_ADAPTER).select();
next();
next();
setAdapterDetailsAndCreateAdapterAndVerifyExistence();
}
Aggregations