diff options
author | Thomas Wolf | 2016-03-22 06:43:20 +0000 |
---|---|---|
committer | Matthias Sohn | 2016-03-22 12:59:26 +0000 |
commit | 5a532855823b2631e61e59b447fe559c4118f70a (patch) | |
tree | c10d5bce7b343f9b34c5944d453cf1f472e05897 /org.eclipse.egit.ui.test | |
parent | 6c77955735e23720cf8dda2a5397188f99dfed88 (diff) | |
download | egit-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>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r-- | org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java | 24 |
1 files changed, 5 insertions, 19 deletions
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 c6c17998a2..8b60cfd9e4 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"); |