Search in sources :

Example 26 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftExplorerItem method activateOpenShiftExplorerView.

protected void activateOpenShiftExplorerView() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.activate();
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 27 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class TriggerBuildTest method testCloneExistingBuild.

@Test
public void testCloneExistingBuild() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(240), true);
    List<OpenShiftResource> builds = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD);
    builds.get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.CLONE_BUILD).select();
    int oldAmountOfBuilds = builds.size();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    try {
        new WaitUntil(new AmountOfResourcesExists(Resource.BUILD, oldAmountOfBuilds + 1, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("New build was not triggered altough it should be.");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) AmountOfResourcesExists(org.jboss.tools.openshift.reddeer.condition.AmountOfResourcesExists) Matcher(org.hamcrest.Matcher) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 28 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method tearDown.

public static void tearDown() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.reopen();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.getProject().delete();
    try {
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()));
    } catch (WaitTimeoutExpiredException ex) {
        connection.refresh();
        new WaitWhile(new OpenShiftProjectExists(connectionReq.getConnection()), TimePeriod.getCustom(5));
    }
    connection.createNewProject();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    if (projectExplorer.containsProject(PROJECT_NAME)) {
        projectExplorer.getProject(PROJECT_NAME).delete(true);
    }
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) OpenShiftProjectExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftProjectExists) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)

Example 29 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView 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 30 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView 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)

Aggregations

OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)22 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)19 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)19 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)19 Test (org.junit.Test)18 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)17 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)16 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)13 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)11 OpenShiftProject (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject)11 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)10 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)7 Before (org.junit.Before)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)4