use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class ImageSearchSWTBotTest method openPullWizard.
private void openPullWizard(final DockerClient client) {
// given
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// expand the 'Images' node
final SWTBotTreeItem imagesTreeItem = SWTUtils.getTreeItem(dockerExplorerViewBot, "Test", "Images");
// when opening the "Pull..." wizard
final SWTBotTree dockerExplorerViewTreeBot = dockerExplorerViewBot.bot().tree();
imagesTreeItem.select();
dockerExplorerViewTreeBot.contextMenu("Pull...").click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class CommandUtilsSWTBotTest method shouldRetrieveConnectionFromSelectedImage.
@Test
public void shouldRetrieveConnectionFromSelectedImage() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("foo").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final SWTBotTreeItem image = SWTUtils.expand(dockerExplorerViewBot.bot().tree(), "Test", "Images", "foo");
// when selecting the images
image.select();
// then current connection should be found
Assertions.assertThat(CommandUtils.getCurrentConnection(dockerExplorerView)).isEqualTo(dockerConnection);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class CommandUtilsSWTBotTest method shouldRetrieveConnectionFromSelectedContainersCategory.
@Test
public void shouldRetrieveConnectionFromSelectedContainersCategory() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("foo_bar").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final SWTBotTreeItem containers = SWTUtils.expand(dockerExplorerViewBot.bot().tree(), "Test", "Containers");
// when selecting the container
containers.select();
// then current connection should be found
Assertions.assertThat(CommandUtils.getCurrentConnection(dockerExplorerView)).isEqualTo(dockerConnection);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class CommandUtilsSWTBotTest method shouldRetrieveConnectionFromSelectedContainerVolumesCategory.
@Test
public void shouldRetrieveConnectionFromSelectedContainerVolumesCategory() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("foo_bar").build(), MockContainerInfoFactory.volume("/path/to/host:/path/to/container:Z,ro").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final SWTBotTreeItem volumes = SWTUtils.expand(dockerExplorerViewBot.bot().tree(), "Test", "Containers", "foo_bar", "Volumes");
volumes.select();
// then current connection should be found
Assertions.assertThat(CommandUtils.getCurrentConnection(dockerExplorerView)).isEqualTo(dockerConnection);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class CommandUtilsSWTBotTest method shouldRetrieveConnectionFromSelectedContainerLink.
@Test
public void shouldRetrieveConnectionFromSelectedContainerLink() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("foo_bar").build(), MockContainerInfoFactory.link("/foo:/bar/foo").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final SWTBotTreeItem link = SWTUtils.expand(dockerExplorerViewBot.bot().tree(), "Test", "Containers", "foo_bar", "Links", "foo (foo)");
// when selecting the Link
link.select();
// then current connection should be found
Assertions.assertThat(CommandUtils.getCurrentConnection(dockerExplorerView)).isEqualTo(dockerConnection);
}
Aggregations