Search in sources :

Example 6 with DockerExplorerView

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.

the class ContainerLogTest method before.

@Before
public void before() {
    deleteAllConnections();
    getConnection();
    pullImage(IMAGE_NAME);
    new WaitWhile(new JobIsRunning());
    DockerExplorerView explorer = new DockerExplorerView();
    explorer.open();
    getConnection().refresh();
    getConnection().getImage(IMAGE_NAME).run();
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.finish();
    if (mockitoIsUsed()) {
        runContainer();
        getConnection().refresh();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
}
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) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Before(org.junit.Before)

Example 7 with DockerExplorerView

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.

the class DockerContainerTest method testRunDockerContainer.

@Test
public void testRunDockerContainer() {
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    assertTrue("Image has not been found!", imageIsDeployed(getCompleteImageName(IMAGE_NAME)));
    DockerExplorerView explorer = new DockerExplorerView();
    getConnection().getImage(getCompleteImageName(IMAGE_NAME)).run();
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.finish();
    if (mockitoIsUsed()) {
        MockUtils.runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    new WaitWhile(new ConsoleHasNoChange());
    assertTrue("Container does not exists!", containerIsDeployed(CONTAINER_NAME));
}
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) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 8 with DockerExplorerView

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView 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 9 with DockerExplorerView

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.

the class ImageTagTest method testAddUpperCaseTagToImage.

@Test
public void testAddUpperCaseTagToImage() {
    DockerExplorerView explorer = new DockerExplorerView();
    explorer.open();
    try {
        getConnection().getImage(IMAGE_NAME).addTagToImage(IMAGE_TAG_UPPERCASE);
    } catch (WaitTimeoutExpiredException ex) {
        new CancelButton().click();
    // swallowing, it is not possible to tag image with upper case
    }
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) Test(org.junit.Test)

Example 10 with DockerExplorerView

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.

the class MockDockerConnectionManager method configureConnectionManager.

/**
 * Configures the {@link DockerConnectionManager} with the given array of
 * {@link IDockerConnection} (can be mocked) and refreshes the associated
 * {@link DockerExplorerView}.
 *
 * @param connectionStorageManager
 *            the {@link IDockerConnectionStorageManager} to use (can be
 *            mocked)
 */
public static void configureConnectionManager(final IDockerConnectionStorageManager connectionStorageManager) {
    DockerConnectionManager.getInstance().setConnectionStorageManager(connectionStorageManager);
    DockerConnectionManager.getInstance().reloadConnections();
    DockerExplorerView de = new DockerExplorerView();
    de.open();
    de.refreshView();
    DockerImagesTab imageTab = new DockerImagesTab();
    imageTab.activate();
    imageTab.refresh();
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.activate();
    containerTab.refresh();
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DockerContainersTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)

Aggregations

DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)14 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)6 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 DockerConnection (org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection)4 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)3 Test (org.junit.Test)3 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)2 Before (org.junit.Before)2 DockerClient (com.spotify.docker.client.DockerClient)1 File (java.io.File)1 IOException (java.io.IOException)1 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)1 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)1 ImageSearchPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage)1 ImageTagSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage)1 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)1 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)1