use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.
the class AbstractDockerBotTest method createConnection.
/**
* Creates a connection with the settings in this test. Stores it in
* instance variable {@link #connection}.
*
* @returns the connection that was creates
*
* @see #SYSPROP_DOCKER_MACHINE_NAME
* @see #SYSPROP_DOCKER_SERVER_URI
* @see #SYSPROP_UNIX_SOCKET
*/
protected DockerConnection createConnection() {
DockerExplorerView dockerView = new DockerExplorerView();
dockerView.open();
String dockerMachineName = System.getProperty(SYSPROP_DOCKER_MACHINE_NAME);
String dockerServerURI = System.getProperty(SYSPROP_DOCKER_SERVER_URI);
String unixSocket = System.getProperty(SYSPROP_UNIX_SOCKET);
String mockito = System.getProperty(SYSPROP_MOCKITO);
if (!StringUtils.isBlank(dockerMachineName)) {
dockerView.createDockerConnectionSearch(dockerMachineName);
this.connection = getConnectionByName(dockerMachineName);
} else if (!StringUtils.isEmpty(dockerServerURI)) {
dockerView.createDockerConnection(AuthenticationMethod.TCP_CONNECTION, dockerServerURI, null, dockerServerURI);
this.connection = getConnectionByHost(dockerServerURI);
} else if (!StringUtils.isEmpty(unixSocket)) {
dockerView.createDockerConnection(AuthenticationMethod.UNIX_SOCKET, unixSocket, null, unixSocket);
this.connection = getConnectionByHost(unixSocket);
} else if ("true".equals(mockito)) {
MockUtils.createDockerMockConnection(DEFAULT_CONNECTION_NAME);
this.connection = getConnectionByName(DEFAULT_CONNECTION_NAME);
} else {
fail("Cannot create a docker connection. " + "Neither " + SYSPROP_DOCKER_MACHINE_NAME + " nor " + SYSPROP_DOCKER_SERVER_URI + " nor " + SYSPROP_UNIX_SOCKET + " were defined nor, " + SYSPROP_MOCKITO + " was enabled.");
}
// can't be null, fails before
connection.enableConnection();
return connection;
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.
the class MockUtils method configureUnixSocketConnection.
private static IDockerConnection configureUnixSocketConnection(final String connectionName, final String pathToSocket) {
DockerClient client = MockDockerClientFactory.build();
final org.eclipse.linuxtools.internal.docker.core.DockerConnection dockerConnection = MockDockerConnectionFactory.from(connectionName, client).withUnixSocketConnectionSettings(pathToSocket);
DockerExplorerView de = new DockerExplorerView();
de.open();
de.createDockerConnectionUnix(dockerConnection);
MockDockerConnectionManager.configureConnectionManager(dockerConnection);
return dockerConnection;
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView in project linuxtools by eclipse.
the class SearchDialogTest method testSearchDialog.
@Test
public void testSearchDialog() {
DockerExplorerView explorer = new DockerExplorerView();
getConnection().openImageSearchDialog(IMAGE_NAME, null, REGISTRY_URL);
ImageSearchPage pageOne = new ImageSearchPage(explorer);
pageOne.searchImage();
assertFalse("Search result is empty!", pageOne.getSearchResults().isEmpty());
assertTrue("Search result do not contains image:" + EXPECTED_IMAGE_NAME + "!", pageOne.searchResultsContains(EXPECTED_IMAGE_NAME));
pageOne.next();
// new WaitUntil(new ShellIsAvailable("Progress Information"), TimePeriod.DEFAULT);
AbstractWait.sleep(TimePeriod.getCustom(5));
ImageTagSelectionPage pageTwo = new ImageTagSelectionPage(pageOne);
assertFalse("Search tags are empty!", pageTwo.getTags().isEmpty());
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
if (!pageTwo.tagsContains(IMAGE_TAG)) {
pageTwo.cancel();
new CancelButton().click();
fail("Search results do not contain tag: " + IMAGE_TAG + "!");
}
pageTwo.selectTag(IMAGE_TAG);
pageTwo.finish();
new PushButton("Finish").click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView 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.DockerExplorerView 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;
}
Aggregations