use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerContainersViewSWTBotTest method shouldProvideEnabledRestartOnMultipleContainers.
@Test
public void shouldProvideEnabledRestartOnMultipleContainers() {
// 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);
// make sure the hierarchy view is closed.
SWTUtils.closeView(this.bot, DockerImageHierarchyView.VIEW_ID);
// open the context menu on one of the containers
selectContainersInTable("gentle_foo", "bold_eagle", "angry_bar");
final SWTBotMenu menuCommand = dockerContainersViewBot.bot().table().contextMenu("Restart");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideDisabledKillCommandOnMultipleContainersAtOnce.
@Test
public void shouldProvideDisabledKillCommandOnMultipleContainersAtOnce() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Running").build()).container(MockContainerFactory.name("angry_bar").status("Stopped").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("Kill");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isNotEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideEnabledKillCommandOnMultipleContainersAtOnce.
@Test
public void shouldProvideEnabledKillCommandOnMultipleContainersAtOnce() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Running").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("Kill");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideEnabledRemoveCommandOnMultipleImagesAtOnce.
@Test
public void shouldProvideEnabledRemoveCommandOnMultipleImagesAtOnce() {
// 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);
// open the context menu on one of the containers
selectImagesInTreeView("Test", "gentle_foo", "angry_bar");
final SWTBotMenu menuCommand = dockerExplorerViewBot.bot().tree().contextMenu("Remove");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class DockerExplorerViewSWTBotTest method shouldProvideDisabledRemoveCommandOnMultipleContainersAtOnce.
@Test
public void shouldProvideDisabledRemoveCommandOnMultipleContainersAtOnce() {
// given
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Running").build()).container(MockContainerFactory.name("angry_bar").status("Stopped").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("Remove");
// then
MenuAssertion.assertThat(menuCommand).isVisible().isNotEnabled();
}
Aggregations