Search in sources :

Example 36 with SWTBotMenu

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();
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 37 with SWTBotMenu

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();
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 38 with SWTBotMenu

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();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 39 with SWTBotMenu

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();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 40 with SWTBotMenu

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();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Aggregations

SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)44 Test (org.junit.Test)27 DockerClient (com.spotify.docker.client.DockerClient)14 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)14 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)3 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)3 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)3 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)3 IsEditorOpened (net.heartsome.test.swtbot.waits.IsEditorOpened)2 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)2 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)2 SWTBotRadio (org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio)2 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)2 ArrayList (java.util.ArrayList)1 ContributionItem (org.eclipse.jface.action.ContributionItem)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)1 AbstractChartBuilder (org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder)1