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));
}
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);
}
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();
}
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);
}
}
Aggregations