Search in sources :

Example 1 with DeleteResourcesWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard 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();
}
Also used : DeleteResourcesWizard(org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) TableItem(org.eclipse.reddeer.swt.api.TableItem) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 2 with DeleteResourcesWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard 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);
}
Also used : DeleteResourcesWizard(org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) TableItem(org.eclipse.reddeer.swt.api.TableItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 3 with DeleteResourcesWizard

use of org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard in project jbosstools-openshift by jbosstools.

the class InteligentDeleteResourceTest method testASearchIsWorking.

@Test
public void testASearchIsWorking() {
    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());
    int sizeBefore = deleteResourcesWizard.getAllResources().size();
    deleteResourcesWizard.setFilter("eap-app");
    assertNotEquals(sizeBefore, deleteResourcesWizard.getAllResources().size());
    deleteResourcesWizard.setFilter("");
    assertEquals(sizeBefore, deleteResourcesWizard.getAllResources().size());
    deleteResourcesWizard.cancel();
}
Also used : DeleteResourcesWizard(org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)3 OpenShiftProject (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject)3 DeleteResourcesWizard (org.jboss.tools.openshift.reddeer.wizard.v3.DeleteResourcesWizard)3 TableItem (org.eclipse.reddeer.swt.api.TableItem)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 Test (org.junit.Test)1