Search in sources :

Example 56 with OpenShiftExplorerView

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

the class CreateNewConnectionTest method openConnectionWizardAndSetDefaultServer.

private void openConnectionWizardAndSetDefaultServer() {
    OpenShiftExplorerView openShiftExplorerView = new OpenShiftExplorerView();
    openShiftExplorerView.open();
    openShiftExplorerView.openConnectionShell();
    new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
    new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
    new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(DatastoreOS3.SERVER);
}
Also used : LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 57 with OpenShiftExplorerView

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

the class ConnectionPropertiesTest method testConnectionProperties.

@Test
public void testConnectionProperties() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.PROPERTIES).select();
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.activate();
    assertEquals("Property host is not valid. Was '" + propertiesView.getProperty(PROPERTY_HOST).getPropertyValue() + "' but was expected '" + DatastoreOS3.SERVER + "'", DatastoreOS3.SERVER, propertiesView.getProperty(PROPERTY_HOST).getPropertyValue());
    if (DatastoreOS3.AUTH_METHOD.equals(AuthenticationMethod.BASIC)) {
        assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + DatastoreOS3.USERNAME + "'", DatastoreOS3.USERNAME, propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
    } else {
        assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + connectionReq.getConnection().getUsername() + "'", connectionReq.getConnection().getUsername(), propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
    }
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 58 with OpenShiftExplorerView

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

the class OpenShiftUtils method getOpenShiftPod.

public static OpenShiftResource getOpenShiftPod(String projectName, Resource resource, Matcher<String> matcher, Connection connection) {
    assertTrue(!StringUtils.isBlank(projectName));
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    List<OpenShiftResource> pods = explorer.getOpenShift3Connection(connection).getProject(projectName).getOpenShiftResources(resource);
    for (OpenShiftResource pod : pods) {
        if (matcher.matches(pod.getName())) {
            return pod;
        }
    }
    fail("Pod with matcher:" + matcher.toString() + " for project " + projectName + " was not found");
    return null;
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)

Example 59 with OpenShiftExplorerView

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

the class OpenShiftUtils method getOpenShiftProject.

public static OpenShiftProject getOpenShiftProject(String projectName, Connection connection) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    OpenShiftProject project = explorer.getOpenShift3Connection(connection).getProject(projectName);
    assertThat("Could not find project " + projectName + " in OpenShift Explorer", project, notNullValue());
    project.expand();
    return project;
}
Also used : OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) 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