use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldShowSelectedImageInPropertiesView.
@Test
public void shouldShowSelectedImageInPropertiesView() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// open the context menu on one the container
selectImagesInTreeView("Test", "angry_bar");
// show images info in Properties view
SWTUtils.getContextMenu(dockerExplorerViewBot.bot().tree(), "Show In", "Properties").click();
// the properties view should be visible
assertThat(this.bot.viewById("org.eclipse.ui.views.PropertySheet").isActive()).isEqualTo(true);
// then the properties view should have a selected tab with container
// info
final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class DockerImagesViewSWTBotTest method shouldShowSelectedImageInPropertiesView.
@Test
public void shouldShowSelectedImageInPropertiesView() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
this.dockerImagesView.setFocus();
// select the container in the table
selectImageInTable("angry_bar");
// then the properties view should have a selected tab with container
// info
assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class DockerImagesViewSWTBotTest method shouldOpenImageHierarchyView.
@Test
public void shouldOpenImageHierarchyView() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).image(MockImageFactory.name("gentle_foo").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// make sure the hierarchy view is closed.
SWTUtils.closeView(this.bot, DockerImageHierarchyView.VIEW_ID);
// open the context menu on one of the containers
selectImageInTable("angry_bar");
SWTUtils.getContextMenu(dockerImagesBotView.bot().table(), "Open Image Hierarchy").click();
// wait 1sec
SWTUtils.wait(1, TimeUnit.SECONDS);
DockerImageHierarchyViewAssertions.assertThat(SWTUtils.getView(bot, DockerImageHierarchyView.VIEW_ID)).isNotNull();
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class DockerImagesViewSWTBotTest method shouldShowAllImageVariants.
@Test
public void shouldShowAllImageVariants() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.id("1a2b3c4d5e6f7g").name("foo:1.0", "foo:latest", "bar:1.0", "bar:latest").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// when
SWTUtils.getTreeItem(dockerExplorerBotView, "Test").select();
// then 1 images with all repo/tags should be displayed
SWTUtils.syncAssert(() -> {
final TableItem[] images = dockerImagesView.getViewer().getTable().getItems();
assertThat(images).hasSize(1);
assertThat(images[0].getText(1)).isEqualTo("bar:1.0\nbar:latest\nfoo:1.0\nfoo:latest");
});
}
use of org.eclipse.linuxtools.internal.docker.core.DockerConnection in project linuxtools by eclipse.
the class ImagePullSWTBotTest method setupDockerClient.
@Before
public void setupDockerClient() {
this.client = MockDockerClientFactory.image(MockImageFactory.name("bar:latest", "foo/bar:latest").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
}
Aggregations