Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2012-12-07 23:14:55 +0000
committerGerrit Code Review @ Eclipse.org2012-12-22 14:08:19 +0000
commit7ef13fcb1b1cccdbbbd4f9b3f953c52320b97817 (patch)
tree0440f93e445583eac1e9783fee4ae7bc78213f1d /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui
parentb061cc62cc07d474508cc3b00fd8ee5998fe2a51 (diff)
downloadegit-7ef13fcb1b1cccdbbbd4f9b3f953c52320b97817.tar.gz
egit-7ef13fcb1b1cccdbbbd4f9b3f953c52320b97817.tar.xz
egit-7ef13fcb1b1cccdbbbd4f9b3f953c52320b97817.zip
Run "click context menu" synchronously where possible in tests
This could further stabilize some tests, as running the context menu action synchronously makes sure that the action is complete before returning to the caller. The asynchronous variant is still necessary for when more UI interaction is required to complete the action. Change-Id: Id28b4cdc8b7e6ca6e993f736dcf70bb621cd8f0e
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleSyncTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java52
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java24
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/DisconnectConnectTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java2
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ShowInTest.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java12
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java10
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java8
14 files changed, 94 insertions, 52 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleSyncTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleSyncTest.java
index 809bf6a719..4d42b5366b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleSyncTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleSyncTest.java
@@ -1,5 +1,5 @@
/******************************************************************************
- * Copyright (c) 2012 GitHub Inc.
+ * Copyright (c) 2012 GitHub Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -99,7 +99,7 @@ public class SubmoduleSyncTest extends GitRepositoriesViewTestBase {
.expandNode(
UIText.RepositoriesViewLabelProvider_SubmodulesNodeText)
.select();
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue(SYNC_SUBMODULE_CONTEXT_MENU_LABEL));
TestUtil.joinJobs(JobFamilies.SUBMODULE_SYNC);
refreshAndWait();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java
index e2ba414a6d..e2d73b60af 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java
@@ -1,5 +1,5 @@
/******************************************************************************
- * Copyright (c) 2012 GitHub Inc.
+ * Copyright (c) 2012 GitHub Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -88,7 +88,7 @@ public class SubmoduleUpdateTest extends GitRepositoriesViewTestBase {
.expandNode(
UIText.RepositoriesViewLabelProvider_SubmodulesNodeText)
.select();
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue(UPDATE_SUBMODULE_CONTEXT_MENU_LABEL));
TestUtil.joinJobs(JobFamilies.SUBMODULE_UPDATE);
refreshAndWait();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
index 47994f76de..4163ddd1f6 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, SAP AG
+ * Copyright (c) 2010, 2012 SAP AG and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -35,7 +35,34 @@ import org.hamcrest.Matcher;
public class ContextMenuHelper {
/**
- * Clicks the context menu matching the text.
+ * Clicks the context menu matching the text, executing the action
+ * synchronously (blocking until the action completes).
+ * <p>
+ * This should be used if the action requires no more UI interaction.
+ *
+ * @param bot
+ *
+ * @param texts
+ * the text on the context menu.
+ * @throws WidgetNotFoundException
+ * if the widget is not found.
+ * @throws SWTException
+ * if the menu item is disabled (the root cause being an
+ * {@link IllegalStateException})
+ */
+ public static void clickContextMenuSync(final AbstractSWTBot<?> bot,
+ final String... texts) {
+ clickContextMenuWithRetry(bot, true, texts);
+ }
+
+ /**
+ * Clicks the context menu matching the text, executing the action
+ * asynchronously (non-blocking).
+ * <p>
+ * This should only be used when further UI interaction is part of the
+ * action, e.g. a dialog or wizard. Using
+ * {@link #clickContextMenuSync(AbstractSWTBot, String...)} is preferred in
+ * other cases.
*
* @param bot
*
@@ -49,12 +76,17 @@ public class ContextMenuHelper {
*/
public static void clickContextMenu(final AbstractSWTBot<?> bot,
final String... texts) {
+ clickContextMenuWithRetry(bot, false, texts);
+ }
+
+ private static void clickContextMenuWithRetry(final AbstractSWTBot<?> bot,
+ final boolean sync, final String... texts) {
int failCount = 0;
int maxFailCount = 4;
long sleepTime = 250;
while (failCount <= maxFailCount)
try {
- clickContextMenuInternal(bot, texts);
+ clickContextMenuInternal(bot, sync, texts);
if (failCount > 0)
System.out.println("Retrying clickContextMenu succeeded");
break;
@@ -77,7 +109,7 @@ public class ContextMenuHelper {
}
private static void clickContextMenuInternal(final AbstractSWTBot<?> bot,
- final String... texts) {
+ final boolean sync, final String... texts) {
// show
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {
@@ -95,7 +127,7 @@ public class ContextMenuHelper {
+ Arrays.asList(texts));
// click
- click(menuItem);
+ click(menuItem, sync);
// hide
UIThreadRunnable.syncExec(new VoidResult() {
@@ -201,18 +233,22 @@ public class ContextMenuHelper {
return null;
}
- private static void click(final MenuItem menuItem) {
+ private static void click(final MenuItem menuItem, boolean sync) {
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() {
+ VoidResult toExecute = new VoidResult() {
public void run() {
menuItem.notifyListeners(SWT.Selection, event);
}
- });
+ };
+ if (sync)
+ UIThreadRunnable.syncExec(menuItem.getDisplay(), toExecute);
+ else
+ UIThreadRunnable.asyncExec(menuItem.getDisplay(), toExecute);
}
private static void hide(final Menu menu) {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
index 7e0e25e149..0f2382453e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
@@ -1,5 +1,5 @@
/******************************************************************************
- * Copyright (c) 2011 GitHub Inc.
+ * Copyright (c) 2011, 2012 GitHub Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -114,7 +114,7 @@ public class CommitEditorTest extends LocalRepositoryTestCase {
SWTBotTable table = commitEditor.bot().table(0);
assertTrue(table.rowCount() > 0);
table.select(0);
- ContextMenuHelper.clickContextMenu(table,
+ ContextMenuHelper.clickContextMenuSync(table,
UIText.CommitFileDiffViewer_ShowAnnotationsMenuLabel);
TestUtil.joinJobs(JobFamilies.BLAME);
assertFalse(commitEditor.getReference().equals(
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
index f38342bbe6..326d368d7b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -256,7 +256,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
explorerItem = testUtil.getChildNode(childItem.expand(), path[2]);
}
explorerItem.select();
- ContextMenuHelper.clickContextMenu(projectExplorerTree, "Show In",
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Show In",
"History");
// join GenerateHistoryJob
Job.getJobManager().join(JobFamilies.GENERATE_HISTORY, null);
@@ -399,7 +399,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
}
});
- ContextMenuHelper.clickContextMenu(table,
+ ContextMenuHelper.clickContextMenuSync(table,
UIText.GitHistoryPage_CheckoutMenuLabel);
TestUtil.joinJobs(JobFamilies.CHECKOUT);
return commit;
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
index 114d1df917..29d9cb19df 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 SAP AG.
+ * Copyright (c) 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -175,8 +175,7 @@ public class CompareActionsTest extends LocalRepositoryTestCase {
git.merge().include(masterId).call();
String menuLabel = util
.getPluginLocalizedValue("CompareWithPreviousAction.label");
- clickCompareWith(menuLabel);
- SWTBotShell selectDialog = bot.shell(UIText.CommitSelectDialog_WindowTitle);
+ SWTBotShell selectDialog = openCompareWithDialog(menuLabel, UIText.CommitSelectDialog_WindowTitle);
assertEquals(2, selectDialog.bot().table().rowCount());
selectDialog.close();
// cleanup: checkout again master and delete merged branch
@@ -253,20 +252,27 @@ public class CompareActionsTest extends LocalRepositoryTestCase {
}
private void clickCompareWith(String menuLabel) {
- SWTBotTree projectExplorerTree = bot.viewById(
- "org.eclipse.jdt.ui.PackageExplorer").bot().tree();
- getProjectItem(projectExplorerTree, PROJ1).select();
- ContextMenuHelper.clickContextMenu(projectExplorerTree, "Compare With",
+ SWTBotTree projectExplorerTree = selectProjectItem();
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Compare With",
menuLabel);
}
- private SWTBotShell openCompareWithDialog(String menuString,
+ private SWTBotShell openCompareWithDialog(String menuLabel,
String dialogTitle) {
- clickCompareWith(menuString);
+ SWTBotTree projectExplorerTree = selectProjectItem();
+ ContextMenuHelper.clickContextMenu(projectExplorerTree, "Compare With",
+ menuLabel);
SWTBotShell dialog = bot.shell(dialogTitle);
return dialog;
}
+ private SWTBotTree selectProjectItem() {
+ SWTBotTree projectExplorerTree = bot.viewById(
+ "org.eclipse.jdt.ui.PackageExplorer").bot().tree();
+ getProjectItem(projectExplorerTree, PROJ1).select();
+ return projectExplorerTree;
+ }
+
private void waitUntilCompareTreeViewTreeHasNodeCount(int nodeCount) {
SWTBotTree tree = bot.viewById(CompareTreeView.ID).bot().tree();
bot.waitUntil(Conditions.treeHasRows(tree, nodeCount), 10000);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/DisconnectConnectTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/DisconnectConnectTest.java
index c65393f281..d86283b8e1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/DisconnectConnectTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/DisconnectConnectTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -83,7 +83,7 @@ public class DisconnectConnectTest extends LocalRepositoryTestCase {
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util
.getPluginLocalizedValue("DisconnectAction_label");
- ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Team",
menuString);
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
index 28bc387d61..8cf91f4452 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
@@ -237,7 +237,7 @@ public class FetchAndMergeActionTest extends LocalRepositoryTestCase {
util.getPluginLocalizedValue("SwitchToMenu.label"),
branchToCheckout };
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.CHECKOUT, 60, TimeUnit.SECONDS);
- ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath);
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, menuPath);
jobJoiner.join();
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ShowInTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ShowInTest.java
index fd59760ef8..caf155c906 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ShowInTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ShowInTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,7 +61,7 @@ public class ShowInTest extends LocalRepositoryTestCase {
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util
.getPluginLocalizedValue("ShowResourceInHistoryAction_label");
- ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Team",
menuString);
bot.viewById(IHistoryView.VIEW_ID).close();
}
@@ -92,7 +92,7 @@ public class ShowInTest extends LocalRepositoryTestCase {
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util
.getPluginLocalizedValue("ShowRepositoryAction_label");
- ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
+ ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Team",
menuString);
bot.viewById(RepositoriesView.VIEW_ID).close();
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java
index 9b63271b27..28111f953f 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewBranchHandlingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -124,19 +124,19 @@ public class GitRepositoriesViewBranchHandlingTest extends
localItem.getNode(0).select();
assertCheckoutNotAvailable(view);
localItem.getNode(1).select();
- ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
+ ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
.getPluginLocalizedValue("CheckoutCommand"));
TestUtil.joinJobs(JobFamilies.CHECKOUT);
assertCheckoutNotAvailable(view);
localItem.getNode(0).select();
- ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
+ ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
.getPluginLocalizedValue("CheckoutCommand"));
TestUtil.joinJobs(JobFamilies.CHECKOUT);
localItem.getNode(1).select();
refreshAndWait();
- ContextMenuHelper.clickContextMenu(bot.tree(), myUtil
+ ContextMenuHelper.clickContextMenuSync(view.bot().tree(), myUtil
.getPluginLocalizedValue("RepoViewDeleteBranch.label"));
refreshAndWait();
localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
@@ -275,7 +275,7 @@ public class GitRepositoriesViewBranchHandlingTest extends
assertEquals("Wrong number of remote children", 2, children.size());
item.getNode("origin/stable").select();
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("CheckoutCommand"));
TestUtil.joinJobs(JobFamilies.CHECKOUT);
refreshAndWait();
@@ -407,7 +407,7 @@ public class GitRepositoriesViewBranchHandlingTest extends
.bot().tree(), clonedRepositoryFile);
localItem.expand().getNode("configTest").select();
- ContextMenuHelper.clickContextMenu(view.bot().tree(),
+ ContextMenuHelper.clickContextMenuSync(view.bot().tree(),
myUtil.getPluginLocalizedValue("ShowIn"),
myUtil.getPluginLocalizedValue("RepoViewOpenProperties.label"));
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
index 81d5cb04bf..f0682f81c9 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -265,14 +265,14 @@ public class GitRepositoriesViewFetchAndPushTest extends
private void runPush(SWTBotTree tree) {
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.PUSH, 10, TimeUnit.SECONDS);
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("SimplePushCommand"));
jobJoiner.join();
}
private void runFetch(SWTBotTree tree) {
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 10, TimeUnit.SECONDS);
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("SimpleFetchCommand"));
jobJoiner.join();
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java
index f3e671d15e..d0e30c35ac 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRemoteHandlingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010-2011 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -100,7 +100,7 @@ public class GitRepositoriesViewRemoteHandlingTest extends
// test the properties view on remote
remotesItem.getNode("test").select();
- ContextMenuHelper.clickContextMenu(tree,
+ ContextMenuHelper.clickContextMenuSync(tree,
myUtil.getPluginLocalizedValue("ShowIn"),
myUtil.getPluginLocalizedValue("RepoViewOpenProperties.label"));
waitInUI();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
index 26fdbbd373..d1792c9826 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -82,7 +82,7 @@ public class GitRepositoriesViewRepoHandlingTest extends
.getInstance());
assertEquals("Clipboard content should be x", "x", value);
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("CopyPathCommand"));
value = (String) clp.getContents(TextTransfer.getInstance());
assertTrue("Clipboard content (" + value
@@ -111,7 +111,7 @@ public class GitRepositoriesViewRepoHandlingTest extends
clip.setContents(new Object[] { repositoryFile.getPath() },
new Transfer[] { TextTransfer.getInstance() });
- ContextMenuHelper.clickContextMenu(label,
+ ContextMenuHelper.clickContextMenuSync(label,
myUtil.getPluginLocalizedValue("PastePathCommand"));
} catch (Exception e) {
exceptions[0] = e;
@@ -138,7 +138,7 @@ public class GitRepositoriesViewRepoHandlingTest extends
assertHasRepo(repositoryFile);
SWTBotTree tree = getOrOpenView().bot().tree();
tree.getAllItems()[0].select();
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue(REMOVE_REPOSITORY_CONTEXT_MENU_LABEL));
refreshAndWait();
assertEmpty();
@@ -237,7 +237,7 @@ public class GitRepositoriesViewRepoHandlingTest extends
"org.eclipse.jdt.ui.PackageExplorer").bot().tree();
SWTBotTreeItem projectItem = getProjectItem(explorerTree, PROJ1)
.select();
- ContextMenuHelper.clickContextMenu(explorerTree, "Show In",
+ ContextMenuHelper.clickContextMenuSync(explorerTree, "Show In",
viewName);
refreshAndWait();
assertHasRepo(repositoryFile);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index 732c72a268..e2e7b1fe39 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 SAP AG.
+ * Copyright (c) 2010, 2012 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -201,7 +201,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
SWTBotTree tree = getOrOpenView().bot().tree();
SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
item.select();
- ContextMenuHelper.clickContextMenu(tree,
+ ContextMenuHelper.clickContextMenuSync(tree,
myUtil.getPluginLocalizedValue("ShowIn"),
myUtil.getPluginLocalizedValue("RepoViewOpenProperties.label"));
SWTBotView propertieView = bot.viewById("org.eclipse.ui.views.PropertySheet");
@@ -552,7 +552,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
tree, repositoryFile).expand();
SWTBotTreeItem masterNode = localBranchesItem.getNode("master");
masterNode.select();
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("RepoViewCheckout.label"));
TestUtil.joinJobs(JobFamilies.CHECKOUT);
ContextMenuHelper.clickContextMenu(tree, myUtil
@@ -607,7 +607,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
repositoryFile).expand();
// delete both
localBranchesItem.select("abc", "123");
- ContextMenuHelper.clickContextMenu(tree, myUtil
+ ContextMenuHelper.clickContextMenuSync(tree, myUtil
.getPluginLocalizedValue("RepoViewDeleteBranch.label"));
refreshAndWait();

Back to the top