use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideDisabledStartCommandOnMultipleContainersAtOnce.
@Test
public void shouldProvideDisabledStartCommandOnMultipleContainersAtOnce() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Stopped").build()).container(MockContainerFactory.name("angry_bar").status("Running").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// open the context menu on one of the containers
selectContainersInTreeView("Test", "gentle_foo", "angry_bar");
final SWTBotMenu menuCommand = dockerExplorerViewBot.bot().tree().contextMenu("Start");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isNotEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideEnabledRestartCommandOnMultipleContainersAtOnce.
@Test
public void shouldProvideEnabledRestartCommandOnMultipleContainersAtOnce() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Running").build()).container(MockContainerFactory.name("bold_eagle").status("Stopped").build()).container(MockContainerFactory.name("angry_bar").status("Running").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// open the context menu on one of the containers
selectContainersInTreeView("Test", "gentle_foo", "bold_eagle", "angry_bar");
final SWTBotMenu menuCommand = dockerExplorerViewBot.bot().tree().contextMenu("Restart");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledRemoveLogCommandOnSelectedContainer.
@Test
public void shouldProvideEnabledRemoveLogCommandOnSelectedContainer() {
// given
shouldDisplayImageHierarchyViewWhenSelectingImage();
// when
selectImageInTreeView(bot, "root", "foo_image1", "foo_image2", "foo_container21");
final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Remove Log");
// then
MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledKillCommandOnSelectedContainer.
@Test
public void shouldProvideEnabledKillCommandOnSelectedContainer() {
// given
shouldDisplayImageHierarchyViewWhenSelectingImage();
// when
selectImageInTreeView(bot, "root", "foo_image1", "foo_container1");
final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Kill");
// then
MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledDisplayLogCommandOnSelectedContainer.
@Test
public void shouldProvideEnabledDisplayLogCommandOnSelectedContainer() {
// given
shouldDisplayImageHierarchyViewWhenSelectingImage();
// when
selectImageInTreeView(bot, "root", "foo_image1", "foo_image2", "foo_container21");
final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Display Log");
// then
MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
Aggregations