Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-06-13 05:35:36 +0000
committerAndrey Loskutov2016-07-02 18:13:46 +0000
commitbbcf647565621bc9a247faf56263c27520b1e431 (patch)
tree52fb65b330c2dd9b3a4a8429a9212ae9616cda3c /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test
parent96fe255d7820f6c35177f1c9727d3e2db11e4356 (diff)
downloadegit-bbcf647565621bc9a247faf56263c27520b1e431.tar.gz
egit-bbcf647565621bc9a247faf56263c27520b1e431.tar.xz
egit-bbcf647565621bc9a247faf56263c27520b1e431.zip
Refactor BranchOperationUI
This class packed too many things into one, resulting in hard to understand flow of control. Also, a class with different "modes" is anathema to object-orientedness and to separation of concerns. Eliminate the different modes from BranchOperationUI: they all just defined which dialog to open initially, if any. Create those dialogs instead in the few places when the static factory methods were used, then use the BranchOperationUI to do the checkout, if appropriate. Simplify RenameBranchDialog by re-using the BranchRenameDialog :-) and by not checking for tags, which are not displayed anyway. Make both the asynchronous (start()) and the synchronous (run()) checkout operations perform the same actions, including project restoration. Factor out the checking for running launches so that it can be re-used elsewhere. Change-Id: If83e7960253d99b04e4a476329647bd009ec8898 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
index bec7c1c63d..a9e88e172c 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
@@ -413,8 +413,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase {
dialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel)
.click();
// rename stable to renamed
- SWTBotShell newNameDialog = bot
- .shell(UIText.RenameBranchDialog_RenameBranchDialogNewNameInputWindowTitle);
+ SWTBotShell newNameDialog = bot.shell(UIText.BranchRenameDialog_Title);
newNameDialog.bot().text().setText("master");
assertFalse(newNameDialog.bot().button(IDialogConstants.OK_LABEL)
.isEnabled());
@@ -431,8 +430,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase {
dialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel)
.click();
// rename renamed to stable
- newNameDialog = bot
- .shell(UIText.RenameBranchDialog_RenameBranchDialogNewNameInputWindowTitle);
+ newNameDialog = bot.shell(UIText.BranchRenameDialog_Title);
newNameDialog.bot().text().setText("stable");
newNameDialog.bot().button(IDialogConstants.OK_LABEL).click();

Back to the top