Search in sources :

Example 1 with ImageRunResourceVolumesVariablesPage

use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage 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 2 with ImageRunResourceVolumesVariablesPage

use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage in project linuxtools by eclipse.

the class VolumeMountTest method testVolumeMount.

@Test
public void testVolumeMount() throws IOException {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_UHTTPD + ":" + IMAGE_TAG_LATEST);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setPublishAllExposedPorts(true);
    firstPage.next();
    ImageRunResourceVolumesVariablesPage secondPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    String volumePath = (new File(VOLUME_PATH)).getCanonicalPath();
    secondPage.addDataVolumeToHost(CONTAINER_PATH, volumePath);
    secondPage.finish();
    new WaitWhile(new JobIsRunning());
    if (!mockitoIsUsed()) {
        new WaitWhile(new ConsoleHasNoChange());
    } else {
        runServer();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    String indexPage = getIndexPageContent();
    String indexPageResource = getResourceAsString(INDEX_PAGE_PATH);
    assertEquals(INDEX_PAGE_PATH + " wasnt mounted/displayed properly.", indexPage, indexPageResource);
}
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) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) File(java.io.File) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Example 3 with ImageRunResourceVolumesVariablesPage

use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage in project linuxtools by eclipse.

the class NetworkModeTest method before.

@Before
public void before() throws DockerException, InterruptedException {
    deleteAllConnections();
    getConnection();
    pullImage(IMAGE_NAME, IMAGE_TAG);
    new WaitWhile(new JobIsRunning());
    DockerExplorerView explorer = new DockerExplorerView();
    getConnection().getImage(IMAGE_NAME).run();
    firstPage = new ImageRunSelectionPage(explorer);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.next();
    ImageRunResourceVolumesVariablesPage variablesPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    variablesPage.next();
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageRunResourceVolumesVariablesPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Before(org.junit.Before)

Example 4 with ImageRunResourceVolumesVariablesPage

use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage in project linuxtools by eclipse.

the class VariablesTest method testVariables.

@Test
public void testVariables() {
    getConnection();
    DockerImagesTab imagesTab = openDockerImagesTab();
    buildImage(IMAGE_NAME, "resources/test-variables", imagesTab);
    if (mockitoIsUsed()) {
        MockUtils.pullImage(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST);
    }
    assertConsoleSuccess();
    imagesTab.activate();
    imagesTab.refresh();
    new WaitWhile(new JobIsRunning());
    imagesTab.runImage(IMAGE_NAME);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.next();
    ImageRunResourceVolumesVariablesPage secondPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    secondPage.addEnviromentVariable("FOO", "barbarbar");
    if (mockitoIsUsed()) {
        MockDockerClientFactory.addContainer(this.client, this.createdContainer, this.containerInfo);
    }
    secondPage.finish();
    new WaitWhile(new JobIsRunning());
    assertConsoleContains("FOO is barbarbar");
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageRunResourceVolumesVariablesPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Aggregations

ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)4 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)4 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)3 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)3 Test (org.junit.Test)3 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 File (java.io.File)1 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)1 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)1 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)1 PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)1 Before (org.junit.Before)1