use of org.eclipse.reddeer.swt.api.TableItem in project jbosstools-openshift by jbosstools.
the class OpenShiftProject method getOpenShiftResources.
/**
* Gets all resources of specific type for project and allows to lock properties view
* @param resourceType resource type
* @param pinView true to lock properties view, false otherwise
* @return list of resources of specified type or empty list if there are no resources
*/
public List<OpenShiftResource> getOpenShiftResources(Resource resourceType, boolean pinView) {
List<OpenShiftResource> resources = new ArrayList<OpenShiftResource>();
expand();
openProperties();
togglePinPropertiesView(pinView);
selectTabbedProperty("Details");
selectTabbedProperty(resourceType.toString());
List<TableItem> tableItems = new DefaultTable().getItems();
if (!tableItems.isEmpty()) {
for (TableItem tableItem : tableItems) {
resources.add(new OpenShiftResource(tableItem));
}
}
togglePinPropertiesView(false);
return resources;
}
use of org.eclipse.reddeer.swt.api.TableItem in project jbosstools-openshift by jbosstools.
the class InteligentDeleteResourceTest method checkDeletedResourceBoolean.
private boolean checkDeletedResourceBoolean(ResourceOpenShift resource) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
OpenShiftProject openshiftProject = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName());
openshiftProject.refresh();
DeleteResourcesWizard deleteResourcesWizard = new DeleteResourcesWizard(connectionReq.getConnection());
deleteResourcesWizard.openWizardFromExplorer(projectReq.getProjectName());
List<TableItem> items = deleteResourcesWizard.getResourcesByType(resource);
deleteResourcesWizard.cancel();
return items.isEmpty();
}
use of org.eclipse.reddeer.swt.api.TableItem in project jbosstools-openshift by jbosstools.
the class InteligentDeleteResourceTest method deleteResource.
private void deleteResource(ResourceOpenShift resource) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
OpenShiftProject openshiftProject = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName());
openshiftProject.refresh();
DeleteResourcesWizard deleteResourcesWizard = new DeleteResourcesWizard(connectionReq.getConnection());
deleteResourcesWizard.openWizardFromExplorer(projectReq.getProjectName());
List<TableItem> items = deleteResourcesWizard.getResourcesByType(resource);
for (TableItem item : items) {
item.select();
}
deleteResourcesWizard.delete();
new WaitUntil(new JobIsRunning(), false);
}
use of org.eclipse.reddeer.swt.api.TableItem in project linuxtools by eclipse.
the class DockerImagesTab method selectImage.
public void selectImage(String imageName) {
activate();
TableItem image = getDockerImage(imageName);
image.select();
}
use of org.eclipse.reddeer.swt.api.TableItem in project jbosstools-openshift by jbosstools.
the class BuilderImageApplicationWizardHandlingTest method testPorts.
@Test
public void testPorts() {
String defaultName = "8443-tcp";
String defaultServicePort = "8443";
String defaultPodPort = "8443";
String newName = "1234-tcp";
String newServicePort = "1234";
String newPodPort = "4321";
nextToBuildConfigurationWizardPage();
next();
next();
// Test edit of an existing pod
new DefaultTable().select(defaultName);
new PushButton(OpenShiftLabel.Button.EDIT).click();
new DefaultShell(OpenShiftLabel.Shell.SERVICE_PORTS);
new LabeledText(OpenShiftLabel.TextLabels.POD_PORT).setText(newPodPort);
new DefaultSpinner(OpenShiftLabel.TextLabels.SERVICE_PORT).setValue(Integer.valueOf(newServicePort));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVICE_PORTS));
assertTrue("There should port mapping with name " + newName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(newName)).test());
TableItem portMapping = new DefaultTable().getItem(newName);
assertTrue("Modified pod mapping has incorrect mapped ports.", portMapping.getText(1).equals(newServicePort) && portMapping.getText(2).equals(newPodPort));
// Test reset of pods
new PushButton(OpenShiftLabel.Button.RESET).click();
new DefaultShell(OpenShiftLabel.Shell.RESET_PORTS);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_PORTS));
new WaitWhile(new JobIsRunning());
assertTrue("There should port mapping with name " + defaultName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(defaultName)).test());
portMapping = new DefaultTable().getItem(defaultName);
String resetServicePort = portMapping.getText(1);
String resetPodPort = portMapping.getText(2);
assertTrue("There should default values for port named " + defaultName + "\n" + "Service port should be " + defaultServicePort + ", but it is " + resetServicePort + " and pod port should be " + defaultPodPort + ", but it is " + resetPodPort, resetServicePort.equals(defaultServicePort) && resetPodPort.equals(defaultPodPort));
}
Aggregations