Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-03-22 02:43:20 -0400
committerMatthias Sohn2016-03-22 08:59:26 -0400
commit5a532855823b2631e61e59b447fe559c4118f70a (patch)
treec10d5bce7b343f9b34c5944d453cf1f472e05897
parent6c77955735e23720cf8dda2a5397188f99dfed88 (diff)
downloadegit-5a532855823b2631e61e59b447fe559c4118f70a.tar.gz
egit-5a532855823b2631e61e59b447fe559c4118f70a.tar.xz
egit-5a532855823b2631e61e59b447fe559c4118f70a.zip
Test stability: fix FeatureFinishSquashTest
The test didn't wait for the shell to open in AbstractFeatureFinishHandlerTest.finishFeature(). Unfortunately, that shell didn't have a title, and was thus a bit inconvenient to wait for. * Give that shell (a TitleAreaDialog) a title. TitleAreaDialog.setTitle() does not set the shell's title! * Simplify the code: use the async clickContextMenu instead of the sync variant wrapped in an asyncExec. Change-Id: I5e26490682821888b4f62da8a323cbc1aeeaded4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java1
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java24
2 files changed, 6 insertions, 19 deletions
diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java
index ddd88429a..44a5bd45b 100644
--- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java
+++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialogs/FinishFeatureDialog.java
@@ -59,6 +59,7 @@ public class FinishFeatureDialog extends TitleAreaDialog {
public void create() {
super.create();
setTitle(UIText.FinishFeatureDialog_title);
+ getShell().setText(UIText.FinishFeatureDialog_title);
setMessage(NLS.bind(
UIText.FinishFeatureDialog_setParameterForFinishing,
featureBranch), IMessageProvider.INFORMATION);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
index c6c17998a..8b60cfd9e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java
@@ -21,7 +21,6 @@ import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.ui.PlatformUI;
import org.junit.runner.RunWith;
/**
@@ -37,12 +36,9 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa
util.getPluginLocalizedValue("TeamMenu.label"),
util.getPluginLocalizedValue("TeamGitFlowMenu.name", false, Activator.getDefault().getBundle()),
util.getPluginLocalizedValue("TeamGitFlowFeatureFinish.name", false, Activator.getDefault().getBundle()) };
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- ContextMenuHelper.clickContextMenuSync(projectExplorerTree, menuPath);
- }
- });
+
+ ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath);
+ bot.waitUntil(shellIsActive(UIText.FinishFeatureDialog_title));
selectOptions();
bot.checkBox(UIText.FinishFeatureDialog_saveAsDefault).click();
bot.button("OK").click();
@@ -65,12 +61,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa
util.getPluginLocalizedValue("TeamGitFlowMenu.name", false, Activator.getDefault().getBundle()),
util.getPluginLocalizedValue("TeamGitFlowFeatureStart.name", false, Activator.getDefault().getBundle()) };
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- ContextMenuHelper.clickContextMenuSync(projectExplorerTree, menuPath);
- }
- });
+ ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath);
bot.waitUntil(shellIsActive(UIText.FeatureStartHandler_provideFeatureName));
bot.text().setText(featureName);
@@ -87,12 +78,7 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa
util.getPluginLocalizedValue("TeamGitFlowMenu.name", false, Activator.getDefault().getBundle()),
util.getPluginLocalizedValue("TeamGitFlowFeatureCheckout.name", false, Activator.getDefault().getBundle()) };
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- ContextMenuHelper.clickContextMenuSync(projectExplorerTree, menuPath);
- }
- });
+ ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath);
bot.waitUntil(shellIsActive(UIText.FeatureCheckoutHandler_selectFeature));
bot.text().setText("these are not the features you're looking for");

Back to the top