use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class CreaterepoWizardTest method setUpBeforeClass.
/**
* Setup the bot, monitor and workspace root.
*/
@BeforeClass
public static void setUpBeforeClass() {
bot = new SWTWorkbenchBot();
root = ResourcesPlugin.getWorkspace().getRoot();
monitor = new NullProgressMonitor();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
} catch (WidgetNotFoundException e) {
// cannot activate main shell, continue anyways
}
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class ProjectExplorerViewRule method before.
@Override
protected void before() {
final SWTWorkbenchBot bot = new SWTWorkbenchBot();
SWTUtils.syncExec(() -> {
try {
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(PROJECT_EXPLORER_VIEW_ID);
} catch (PartInitException e) {
e.printStackTrace();
return null;
}
});
this.projectExplorerBotView = bot.viewById(PROJECT_EXPLORER_VIEW_ID);
this.projectExplorerBotView.setFocus();
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class DockerContainersViewSWTBotTest method setup.
@Before
public void setup() {
this.bot = new SWTWorkbenchBot();
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("defaultcon").status("Running").build()).image(MockImageFactory.id("987654321abcde").name("default:1").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Default", client).withDefaultTCPConnectionSettings();
dockerConnection.removeContainerListener(DockerContainerRefreshManager.getInstance());
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
SWTUtils.asyncExec(() -> {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(DockerContainersView.VIEW_ID);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(DockerExplorerView.VIEW_ID);
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Failed to open Docker Explorer view: " + e.getMessage());
}
});
this.dockerContainersViewBot = bot.viewById(DockerContainersView.VIEW_ID);
this.dockerContainersView = (DockerContainersView) (dockerContainersViewBot.getViewReference().getView(true));
this.dockerExplorerBotView = bot.viewById(DockerExplorerView.VIEW_ID);
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class DockerImageHierarchyViewSWTBotTest method setupViews.
@Before
public void setupViews() {
this.bot = new SWTWorkbenchBot();
SWTUtils.asyncExec(() -> {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(DockerExplorerView.VIEW_ID);
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Failed to open Docker Explorer view: " + e.getMessage());
}
});
this.dockerExplorerViewBot = bot.viewById(DockerExplorerView.VIEW_ID);
this.dockerExplorerView = (DockerExplorerView) (dockerExplorerViewBot.getViewReference().getView(true));
// make sure that the Docker Image Hierarchy view is closed
this.bot.views().stream().filter(v -> v.getReference().getId().equals(DockerImageHierarchyView.VIEW_ID)).forEach(v -> v.close());
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class DockerImagesViewSWTBotTest method setup.
@Before
public void setup() {
this.bot = new SWTWorkbenchBot();
final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("angry_bar").status("Stopped").build()).image(MockImageFactory.id("987654321abcde").name("default:1").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Default", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
SWTUtils.asyncExec(() -> {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(DockerExplorerView.VIEW_ID);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(DockerImagesView.VIEW_ID);
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Failed to open Docker Images view: " + e.getMessage());
}
});
this.dockerImagesBotView = bot.viewById("org.eclipse.linuxtools.docker.ui.dockerImagesView");
this.dockerImagesView = (DockerImagesView) (dockerImagesBotView.getViewReference().getView(true));
this.dockerExplorerBotView = bot.viewById(DockerExplorerView.VIEW_ID);
}
Aggregations