Search in sources :

Example 1 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class AbstractDockerBotTest method openPropertiesTab.

protected PropertySheet openPropertiesTab(String tabName) {
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().select();
    propertiesView.selectTab(tabName);
    return propertiesView;
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Example 2 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class AbstractDockerBotTest method openPropertiesTabForContainer.

protected PropertySheet openPropertiesTabForContainer(String tabName, String containerName) {
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().getContainer(containerName).select();
    propertiesView.selectTab(tabName);
    return propertiesView;
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Example 3 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class AbstractDockerBotTest method isDockerDaemon.

/**
 * Returns {@code true} if the running docker daemon matches at least the
 * given major and minor version. Returns {@code false} otherwise.
 *
 * @param majorVersion
 * @param minorVersion
 * @return
 */
protected boolean isDockerDaemon(int majorVersion, int minorVersion) {
    PropertySheet infoTab = openPropertiesTab("Info");
    getConnection().select();
    String daemonVersion = infoTab.getProperty("Version").getPropertyValue();
    assertTrue("Could not retrieve docker daemon version.", !StringUtils.isBlank(daemonVersion));
    String[] versionComponents = daemonVersion.split("\\.");
    assertTrue("Could not evaluate docker daemon version " + daemonVersion, versionComponents == null || versionComponents.length >= 2);
    int actualMajorVersion = Integer.parseInt(versionComponents[0]);
    if (actualMajorVersion > majorVersion) {
        return true;
    }
    int actualMinorVersion = Integer.parseInt(versionComponents[1]);
    return actualMinorVersion >= minorVersion;
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Example 4 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class LabelsTest method testLabels.

@Test
public void testLabels() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.setGiveExtendedPrivileges();
    firstPage.next();
    ImageRunResourceVolumesVariablesPage secondPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    secondPage.addLabel(CONTAINER_LABEL_KEY, CONTAINER_LABEL_VALUE);
    secondPage.finish();
    new WaitWhile(new JobIsRunning());
    if (mockitoIsUsed()) {
        // MockDockerClientFactory.addContainer(this.client, this.createdContainer, this.containerInfo);
        runContainer();
        getConnection().refresh();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.searchContainer(CONTAINER_NAME);
    containerTab.select(CONTAINER_NAME);
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().getContainer(CONTAINER_NAME).select();
    propertiesView.selectTab("Inspect");
    String labelProp = propertiesView.getProperty("Config", "Labels", CONTAINER_LABEL_KEY).getPropertyValue();
    assertTrue("Container does not have label " + CONTAINER_LABEL_KEY + "!", labelProp.equals(CONTAINER_LABEL_VALUE));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) ImageRunResourceVolumesVariablesPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DockerContainersTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 5 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class LinkContainersTest method getHttpServerAddress.

private String getHttpServerAddress(String containerName) {
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().getContainer(containerName).select();
    propertiesView.selectTab("Inspect");
    return propertiesView.getProperty("NetworkSettings", "IPAddress").getPropertyValue();
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Aggregations

PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)18 Test (org.junit.Test)9 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)7 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)5 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)5 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)3 TableItem (org.eclipse.reddeer.swt.api.TableItem)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)2 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)2 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)1 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 Before (org.junit.Before)1