Search in sources :

Example 11 with DockerExplorerView

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

the class MockUtils method createDockerMockConnection.

public static void createDockerMockConnection(String connectionName) {
    DockerExplorerView de = new DockerExplorerView();
    de.open();
    File dockerSocketTmpFile = null;
    try {
        dockerSocketTmpFile = File.createTempFile("dockerMock", ".sock");
    } catch (IOException e) {
        new Exception("Cannot create mocked Docker connection!");
        e.printStackTrace();
    }
    MockDockerConnectionSettingsFinder.validUnixSocketConnectionAvailable(connectionName, "unix://" + dockerSocketTmpFile.getAbsolutePath());
    de.createDockerConnectionUnix(configureUnixSocketConnection(connectionName, "unix://" + dockerSocketTmpFile.getAbsolutePath()));
    assertTrue("Docker connection does not exist! ", de.connectionExistForName(connectionName));
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException)

Example 12 with DockerExplorerView

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

the class NewDockerConnectionPage method open.

public void open() {
    new DockerExplorerView().open();
    new DefaultToolItem("Add Connection").click();
    new WaitUntil(new ShellIsAvailable(NEW_DOCKER_CONNECTION_SHELL), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 13 with DockerExplorerView

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

the class CDKServerAdapterAbstractTest method testDockerConnection.

/**
 * Tests Docker connection
 *
 * @param dockerDaemon name of docker connection
 */
public void testDockerConnection(String dockerDaemon) {
    DockerExplorerView dockerExplorer = new DockerExplorerView();
    dockerExplorer.open();
    DockerConnection connection = dockerExplorer.getDockerConnectionByName(dockerDaemon);
    if (connection == null) {
        // $NON-NLS-1$
        fail("Could not find Docker connection " + dockerDaemon);
    }
    connection.select();
    connection.enableConnection();
    connection.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    try {
        // $NON-NLS-1$
        assertTrue("Docker connection does not contain any images", connection.getImagesNames().size() > 0);
    } catch (WaitTimeoutExpiredException ex) {
        ex.printStackTrace();
        fail(// $NON-NLS-1$
        "WaitTimeoutExpiredException occurs when expanding" + " Docker connection " + // $NON-NLS-1$
        dockerDaemon);
    } catch (JFaceLayerException jFaceExc) {
        jFaceExc.printStackTrace();
        fail(jFaceExc.getMessage());
    }
    dockerExplorer.close();
}
Also used : DockerConnection(org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JFaceLayerException(org.eclipse.reddeer.jface.exception.JFaceLayerException) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 14 with DockerExplorerView

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

the class DeployDockerImageTest method pullHelloImageIfDoesNotExist.

/**
 * If hello world docker image does not exist, this method will pull it.
 */
private static void pullHelloImageIfDoesNotExist() {
    DockerExplorerView dockerExplorer = new DockerExplorerView();
    DockerConnection dockerConnection = dockerExplorer.getDockerConnectionByName(DOCKER_CONNECTION);
    dockerConnection.getTreeItem().expand();
    new WaitWhile(new JobIsRunning());
    new WaitWhile(new TreeContainsItem(dockerConnection.getTreeItem().getParent(), dockerConnection.getTreeItem().getText(), "Loading..."), TimePeriod.LONG);
    if (dockerConnection.getImage(HELLO_OS_DOCKER_IMAGE, TAG) == null) {
        dockerConnection.pullImage(HELLO_OS_DOCKER_IMAGE, TAG);
    }
}
Also used : DockerConnection(org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) TreeContainsItem(org.eclipse.reddeer.swt.condition.TreeContainsItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

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