use of org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method createDockerConnection.
public static void createDockerConnection() {
dockerExplorer = new DockerExplorerView();
dockerExplorer.open();
List<String> connectionsNames = dockerExplorer.getDockerConnectionNames();
if (!connectionsNames.isEmpty()) {
for (String connectionName : connectionsNames) {
DockerConnection dockerConnection = dockerExplorer.getDockerConnectionByName(connectionName);
if (dockerConnection != null) {
dockerConnection.removeConnection();
}
}
}
dockerExplorer.createDockerConnectionURI(connectionsURI, connectionsURI, pathToCertificate);
}
use of org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method debugDockerImageTest.
/**
* Auxiliary method for helping with debugging JBIDE-23841.
* This method maximizes Docker explorer view, captures screenshot and restores the view back.
* It also gathers some info and returns it.
*/
private static String debugDockerImageTest() {
String message = "";
DockerExplorerView dockerExplorerView = new DockerExplorerView();
dockerExplorerView.maximize();
try {
ScreenshotCapturer.getInstance().captureScreenshot("DeployDockerImageTest#setup");
} catch (CaptureScreenshotException e) {
// Capturing screenshot was not successfull. No big deal.
LOGGER.debug("Capturing screenshot was not succesfull.");
}
dockerExplorerView.restore();
List<String> names = dockerExplorerView.getDockerConnectionNames();
for (String name : names) {
DockerConnection connection = dockerExplorerView.getDockerConnectionByName(name);
TreeItem treeItem = connection.getTreeItem();
message += "TreeItem for connection \"" + name + "\": " + treeItem.getText() + "\n";
}
return message;
}
use of org.eclipse.linuxtools.docker.reddeer.ui.resources.DockerConnection 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.resources.DockerConnection 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