use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class EditDockerConnectionSWTBotTest method configureUnixSocketConnection.
private IDockerConnection configureUnixSocketConnection(final String connectionName) {
final DockerClient client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from(connectionName, client).withUnixSocketConnectionSettings("/var/run/docker.sock");
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
return dockerConnection;
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class EditDockerConnectionSWTBotTest method configureTCPConnection.
private IDockerConnection configureTCPConnection(final String connectionName) {
final DockerClient client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from(connectionName, client).withTCPConnectionSettings("https://foo:1234", PATH_TO_CERTS);
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
return dockerConnection;
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class ImagePullSWTBotTest method shouldDisablePullCommandWhenConnectionStateIsUnknown.
@Test
public void shouldDisablePullCommandWhenConnectionStateIsUnknown() {
// given
this.client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withState(EnumDockerConnectionState.UNKNOWN);
assertThat(dockerConnection.getState()).isEqualTo(EnumDockerConnectionState.UNKNOWN);
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// when
// when opening the "Push Image..." wizard
SWTUtils.getTreeItem(dockerExplorerViewBot, "Test").select();
// then
MenuAssertion.assertThat(dockerExplorerViewBot.bot().tree().contextMenu("Pull...")).isNotEnabled();
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class ImagePullSWTBotTest method shouldEnablePullCommandWhenConnectionIsEstablished.
@Test
public void shouldEnablePullCommandWhenConnectionIsEstablished() {
// given
this.client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// when
// when opening the "Push Image..." wizard
SWTUtils.getTreeItem(dockerExplorerViewBot, "Test").select();
// then
SWTUtils.wait(1, TimeUnit.SECONDS);
assertThat(dockerConnection.getState()).isEqualTo(EnumDockerConnectionState.ESTABLISHED);
MenuAssertion.assertThat(dockerExplorerViewBot.bot().tree().contextMenu("Pull...")).isEnabled();
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class ImageRunSWTBotTest method shouldReportErrorIfContainerWithSameNameExists.
@Test
public void shouldReportErrorIfContainerWithSameNameExists() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("foo:latest").build()).container(MockContainerFactory.name("foo_bar").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// expand the 'Images' node and select the 'foo' images
SWTUtils.getTreeItem(dockerExplorerViewBot, "Test", "Images", "foo").select();
// when opening the "Run Image..." wizard
final SWTBotTree dockerExplorerViewTreeBot = dockerExplorerViewBot.bot().tree();
dockerExplorerViewTreeBot.contextMenu("Run...").click();
// when use an existing container name
bot.textWithLabel(WizardMessages.getString("ImageRunSelectionPage.containerName")).setText("foo_bar");
// then
// wait for https://bugs.eclipse.org/bugs/show_bug.cgi?id=482889 to be
// able to check the wizard validation message
// assertThat(bot.text(WizardMessages.getString("ImageRunSelectionPage.containerWithSameName"))).isNotNull();
ButtonAssertions.assertThat(bot.button("Finish")).isNotEnabled();
}
Aggregations