Search in sources :

Example 6 with SWTBotMenu

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();
}
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 7 with SWTBotMenu

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();
}
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 8 with SWTBotMenu

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();
}
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 9 with SWTBotMenu

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();
}
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 10 with SWTBotMenu

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();
}
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)

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