本文整理汇总了Java中org.eclipse.swtbot.swt.finder.results.VoidResult类的典型用法代码示例。如果您正苦于以下问题:Java VoidResult类的具体用法?Java VoidResult怎么用?Java VoidResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VoidResult类属于org.eclipse.swtbot.swt.finder.results包,在下文中一共展示了VoidResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testImportSession
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Test
public void testImportSession() {
// given
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.eclemma.ui.CoverageView");
} catch (PartInitException e) {
e.printStackTrace();
}
}
});
// when
SWTBotView view = bot.viewByTitle("Coverage");
view.bot().tree().contextMenu("Import Session...").click();
// then
bot.shell("Import").activate();
bot.text(" Please select an existing execution data file.");
}
示例2: testStarted
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
public void testStarted(final Description description) {
if (!screenshotsCleared) {
deleteDirectoryContents(new File(screenshotFolder));
screenshotsCleared = true;
}
testFailed = false;
testStepStarted = false;
if (description.getTestClass() != null) {
testClassName = description.getTestClass().getName();
} else {
testClassName = testClass.getSimpleName();
}
testMethodName = description.getMethodName();
AbstractTestStep.registerTestStepListener(this);
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().addMouseListener(TestRunRecording.this);
}
});
start();
}
示例3: testFinished
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
public void testFinished(final Description description) {
stop();
AbstractTestStep.removeTestStepListener(this);
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().removeMouseListener(TestRunRecording.this);
}
});
if (!testFailed) {
deleteScreenshots();
}
}
示例4: click
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/**
* Clicks on the {@link MenuItem}.
*
* @param menuItem
* the {@link MenuItem} to click on
*/
private static void click(final MenuItem menuItem) {
final Event event = new Event();
event.time = (int) System.currentTimeMillis();
event.widget = menuItem;
event.display = menuItem.getDisplay();
event.type = SWT.Selection;
UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
@Override
public void run() {
if (SWTUtils.hasStyle(menuItem, SWT.CHECK) || SWTUtils.hasStyle(menuItem, SWT.RADIO)) {
menuItem.setSelection(!menuItem.getSelection());
}
menuItem.notifyListeners(SWT.Selection, event);
}
});
}
示例5: openEditorAsync
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/**
* Opens the editor asynchronously.
*
* @param file
* the file
* @param editorId
* the editor id
* @param activate
* true to activate, false otherwise
*/
protected void openEditorAsync(final IFile file, final String editorId, final boolean activate) {
asyncExec(new VoidResult() {
@Override
public void run() {
try {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
final int matchFlags = IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT;
final IEditorInput input = new FileEditorInput(file);
IEditorPart editor = activePage.openEditor(input, editorId, activate, matchFlags);
editor.setFocus();
waitForEditorJobs(editor);
} catch (PartInitException e) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(e.getMessage(), e);
}
}
}
});
}
示例6: beforeClass
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public static void beforeClass() {
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
resetWorkbench();
resetToolbox();
// close browser-based welcome screen (if open)
SWTWorkbenchBot bot = new SWTWorkbenchBot();
try {
SWTBotView welcomeView = bot.viewByTitle("Welcome");
welcomeView.close();
} catch (WidgetNotFoundException e) {
return;
}
}
});
}
示例7: testController
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Override
@Test
public void testController() throws ESException {
final Player player = createPlayerAndCommit();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
final UIShowHistoryController showHistoryController =
new UIShowHistoryController(bot.getDisplay().getActiveShell(), player);
showHistoryController.execute();
}
});
final SWTBotView historyView = bot.viewById(
"org.eclipse.emf.emfstore.client.ui.views.historybrowserview.HistoryBrowserView");
assertNotNull(historyView);
}
示例8: testController
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Override
@Test
public void testController() throws ESException {
createPlayerAndCommit();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
final UIShowHistoryController showHistoryController =
new UIShowHistoryController(bot.getDisplay().getActiveShell(), localProject);
showHistoryController.execute();
}
});
final SWTBotView historyView = bot.viewById(
"org.eclipse.emf.emfstore.client.ui.views.historybrowserview.HistoryBrowserView");
assertNotNull(historyView);
}
示例9: createTag
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
private ESPathQuery createTag() throws ESException {
ESPrimaryVersionSpec baseVersion = localProject.getBaseVersion();
createPlayerAndCommit();
ESPathQuery pathQuery = ESHistoryQuery.FACTORY
.pathQuery(baseVersion, localProject.getBaseVersion(), true, true);
List<ESHistoryInfo> historyInfos = localProject.getHistoryInfos(pathQuery, new NullProgressMonitor());
assertEquals(2, historyInfos.size());
final ESHistoryInfo historyInfo = historyInfos.get(1);
assertEquals(2, historyInfo.getTagSpecs().size());
UIThreadRunnable.asyncExec(
new VoidResult() {
public void run() {
UIAddTagController addTagController = new UIAddTagController(bot.getDisplay().getActiveShell(),
localProject, historyInfo);
addTagController.execute();
}
});
bot.table(0).select(0);
SWTBotButton button = bot.button("OK");
button.click();
return pathQuery;
}
示例10: addServer
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
private void addServer() {
final int howManyServers = ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
final UIAddServerController addServerController = new UIAddServerController(
bot.getDisplay().getActiveShell());
addServerController.execute();
}
});
bot.button("Finish").click();
bot.waitUntil(new DefaultCondition() {
// BEGIN SUPRESS CATCH EXCEPTION
public boolean test() throws Exception {
return howManyServers + 1 == ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size();
}
public String getFailureMessage() {
return "Add server did not succeed.";
}
// END SUPRESS CATCH EXCEPTION
});
assertEquals(howManyServers + 1, ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size());
}
示例11: baseBeforeTest
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Before
public void baseBeforeTest() {
// Sets codenvy fake API
CodenvyAPI.setClient(new FakeCodenvyClient());
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
final Shell eclipseShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
eclipseShell.forceFocus();
}
});
try {
final SWTBotView welcomeView = bot.viewByTitle("Welcome");
welcomeView.close();
} catch (WidgetNotFoundException e) {
// ignore the exception
}
}
示例12: selectTab
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
protected void selectTab(SWTBotGefEditPart part, String label) {
selectPart(part);
Matcher<TabbedPropertyList> matcher = new BaseMatcher<TabbedPropertyList>() {
@Override
public boolean matches(Object item) {
if (item instanceof TabbedPropertyList) {
return true;
}
return false;
}
@Override
public void describeTo(Description description) {
}
};
List<TabbedPropertyList> allWidgets = widget(matcher);
UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
@Override
public void run() {
for (final TabbedPropertyList tabbedProperty : allWidgets) {
final ListElement tabItem = getTabItem(label, tabbedProperty);
if (tabItem != null) {
final Event mouseEvent = createEvent(tabItem);
tabItem.notifyListeners(SWT.MouseUp, mouseEvent);
tabItem.setFocus();
return;
}
}
throw new IllegalStateException("Unable to select the tab " + label);
}
});
}
示例13: setInit
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public void setInit(SWTBotGefEditPart part, String script) {
selectPart(part);
selectTab(part, INIT);
SWTBotStyledText st = bot.styledTextWithId( WIDGET_ID, WIDGET_SCRIPT);
st.setText(script);
UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
@Override
public void run() {
st.widget.notifyListeners(SWT.FocusOut, null);
editor.setFocus();
}
});
}
示例14: syncWithUIThread
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
protected void syncWithUIThread() {
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
while (PlatformUI.getWorkbench().getDisplay().readAndDispatch()) {
}
}
});
}
示例15: setGuard
import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public void setGuard(SWTBotGefEditPart part, String script) {
selectPart(part);
selectTab(part, GUARD);
SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_GUARD_SCRIPT);
st.setText(script);
UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
@Override
public void run() {
st.widget.notifyListeners(SWT.FocusOut, null);
editor.setFocus();
}
});
}