Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2013-08-21 19:31:45 +0000
committerRobin Stocker2013-08-21 22:30:09 +0000
commit0e059bd11e0699af8185fd168e8a00746dd470b3 (patch)
treeafa65d9461ac69feaf7d0eba9af4cb78fe2bb866
parenta560ae0d017af36016bc4912d6db7b07d7c46eaf (diff)
downloadegit-0e059bd11e0699af8185fd168e8a00746dd470b3.tar.gz
egit-0e059bd11e0699af8185fd168e8a00746dd470b3.tar.xz
egit-0e059bd11e0699af8185fd168e8a00746dd470b3.zip
Fix instability in GitRepositoriesViewTest
* Checkout entry is not shown if branch is already checked out * Make sure original state is restored after checking out other branch * Don't reuse tree node, sometimes the widget will be disposed because it was replaced by another one. See https://hudson.eclipse.org/egit/job/egit-stable.gerrit/70/ Change-Id: I19f8c17009400848b2880bf5fd1f30dace9af7ef Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java8
1 files changed, 5 insertions, 3 deletions
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 c76f346a27..8d0e1368c0 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
@@ -131,6 +131,10 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
String contentStable = getTestFileContent();
assertTrue("Content of master and stable should differ", !contentMaster
.equals(contentStable));
+
+ // checkout master again to restore original state before test
+ myRepoViewUtil.getLocalBranchesItem(tree, repositoryFile).expand()
+ .getNode("master").doubleClick();
}
/**
@@ -551,9 +555,6 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
tree, repositoryFile).expand();
SWTBotTreeItem masterNode = localBranchesItem.getNode("master");
masterNode.select();
- ContextMenuHelper.clickContextMenuSync(tree, myUtil
- .getPluginLocalizedValue("RepoViewCheckout.label"));
- TestUtil.joinJobs(JobFamilies.CHECKOUT);
ContextMenuHelper.clickContextMenu(tree, myUtil
.getPluginLocalizedValue("RepoViewCreateBranch.label"));
SWTBotShell createBranchShell = bot
@@ -637,6 +638,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
bot.waitUntil(shellCloses(confirm));
TestUtil.joinJobs(JobFamilies.REPO_VIEW_REFRESH);
+ folder = findWorkdirNode(tree, PROJ1, FOLDER);
assertThat(folder.getNodes(), not(hasItem(FILE1)));
assertThat(folder.getNodes(), hasItem(FILE2));
}

Back to the top