Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Kinzler2010-08-11 14:17:06 +0000
committerMathias Kinzler2010-08-11 15:13:49 +0000
commitc72dc6177cf07b2cfdeeafca9569e073ce39adc6 (patch)
tree5be7cd0c97b1ed7bd3868c2684be05d10973b334 /org.eclipse.egit.ui.test/src/org
parentcf12cbbba845bbaab24f312b481551915b319294 (diff)
downloadegit-c72dc6177cf07b2cfdeeafca9569e073ce39adc6.tar.gz
egit-c72dc6177cf07b2cfdeeafca9569e073ce39adc6.tar.xz
egit-c72dc6177cf07b2cfdeeafca9569e073ce39adc6.zip
Checkout branch: use common UI
This makes the "checkout branch" UI re-usable for both the Repositories View and the History View so that we have the same labels and so on. Change-Id: Id087c439eb06a8c0771c81a007667d0c35ecec98 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java8
-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/GitRepositoriesViewTest.java17
3 files changed, 21 insertions, 16 deletions
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 0f56eb382..ef526cce6 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
@@ -263,9 +263,11 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
ContextMenuHelper.clickContextMenu(table, util
.getPluginLocalizedValue("CreateBranch.label"));
SWTBotShell dialog = bot
- .shell(UIText.BranchSelectionDialog_QuestionNewBranchTitle);
- dialog.bot().text().setText("NewBranch");
- dialog.bot().button(IDialogConstants.OK_LABEL).click();
+ .shell(UIText.CreateBranchWizard_NewBranchTitle);
+ dialog.bot().textWithId("BranchName").setText("NewBranch");
+ // for some reason, checkboxwithlabel doesn't seem to work
+ dialog.bot().checkBox().deselect();
+ dialog.bot().button(IDialogConstants.FINISH_LABEL).click();
waitInUI();
assertNotNull(repo.resolve(Constants.R_HEADS + "NewBranch"));
}
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 0a0edf1fc..5c9d9986a 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
@@ -97,10 +97,10 @@ public class GitRepositoriesViewBranchHandlingTest extends
.getPluginLocalizedValue("CreateBranchCommand"));
SWTBotShell createPage = bot
- .shell(UIText.RepositoriesView_NewBranchTitle);
+ .shell(UIText.CreateBranchWizard_NewBranchTitle);
createPage.activate();
// getting text with label doesn't work
- createPage.bot().text(1).setText("newLocal");
+ createPage.bot().textWithId("BranchName").setText("newLocal");
createPage.bot().checkBox(UIText.CreateBranchPage_CheckoutButton)
.deselect();
createPage.bot().button(IDialogConstants.FINISH_LABEL).click();
@@ -171,9 +171,9 @@ public class GitRepositoriesViewBranchHandlingTest extends
item.getNode("origin/stable").select();
ContextMenuHelper.clickContextMenu(tree, myUtil
.getPluginLocalizedValue("CreateBranchCommand"));
- SWTBotShell shell = bot.shell(UIText.RepositoriesView_NewBranchTitle);
+ SWTBotShell shell = bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
shell.activate();
- assertEquals("stable", shell.bot().text(1).getText());
+ assertEquals("stable", shell.bot().textWithId("BranchName").getText());
shell.bot().button(IDialogConstants.FINISH_LABEL).click();
refreshAndWait();
item = myRepoViewUtil.getLocalBranchesItem(tree, clonedRepositoryFile)
@@ -257,10 +257,10 @@ public class GitRepositoriesViewBranchHandlingTest extends
.getPluginLocalizedValue("CreateBranchCommand"));
SWTBotShell createPage = bot
- .shell(UIText.RepositoriesView_NewBranchTitle);
+ .shell(UIText.CreateBranchWizard_NewBranchTitle);
createPage.activate();
assertEquals("Wrong suggested branch name", "stable", createPage
- .bot().text(1).getText());
+ .bot().textWithId("BranchName").getText());
createPage.close();
} finally {
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 2791ecb47..9974f58bd 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
@@ -149,7 +149,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
public void testExpandWorkDir() throws Exception {
SWTBotTree tree = getOrOpenView().bot().tree();
Repository myRepository = lookupRepository(repositoryFile);
- List<String> children = Arrays.asList(myRepository.getWorkTree().list());
+ List<String> children = Arrays
+ .asList(myRepository.getWorkTree().list());
List<String> treeChildren = myRepoViewUtil.getWorkdirItem(tree,
repositoryFile).expand().getNodes();
assertTrue(children.containsAll(treeChildren)
@@ -584,8 +585,9 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
SWTBotTreeItem masterNode = localBranchesItem.getNode("master");
masterNode.select();
ContextMenuHelper.clickContextMenu(tree, "Create Branch...");
- SWTBotShell createBranchShell = bot.shell("Create Branch");
- createBranchShell.bot().text("").setText("abc");
+ SWTBotShell createBranchShell = bot
+ .shell(UIText.CreateBranchWizard_NewBranchTitle);
+ createBranchShell.bot().textWithId("BranchName").setText("abc");
createBranchShell.bot().checkBox().deselect();
createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
refreshAndWait();
@@ -616,14 +618,15 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
// create first branch (abc)
masterNode.select();
ContextMenuHelper.clickContextMenu(tree, "Create Branch...");
- SWTBotShell createBranchShell = bot.shell("Create Branch");
- createBranchShell.bot().text("").setText("abc");
+ SWTBotShell createBranchShell = bot
+ .shell(UIText.CreateBranchWizard_NewBranchTitle);
+ createBranchShell.bot().textWithId("BranchName").setText("abc");
createBranchShell.bot().checkBox().deselect();
createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
// create second branch (123)
ContextMenuHelper.clickContextMenu(tree, "Create Branch...");
- createBranchShell = bot.shell("Create Branch");
- createBranchShell.bot().text("").setText("123");
+ createBranchShell = bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
+ createBranchShell.bot().textWithId("BranchName").setText("123");
createBranchShell.bot().checkBox().deselect();
createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
refreshAndWait();

Back to the top