Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java12
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java8
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java3
3 files changed, 13 insertions, 10 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
index 85c921494e..77ec5cf2f2 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
@@ -94,8 +94,7 @@ public class GitRepositoriesViewFetchAndPushTest extends
Activator.getDefault().getRepositoryUtil().addConfiguredRepository(
clonedRepositoryFile);
shareProjects(clonedRepositoryFile);
- SWTBotTree tree = getOrOpenView().bot().tree();
- tree.select(0);
+
Repository repository = lookupRepository(clonedRepositoryFile);
// add the configuration for push
@@ -109,6 +108,9 @@ public class GitRepositoriesViewFetchAndPushTest extends
new Git(repository).branchRename().setOldName(currentBranch)
.setNewName("" + System.currentTimeMillis()).call();
+ SWTBotTree tree = getOrOpenView().bot().tree();
+ tree.select(0);
+
TestUtil.waitForJobs(50, 5000);
selectNode(tree, useRemote, false);
@@ -154,9 +156,11 @@ public class GitRepositoriesViewFetchAndPushTest extends
objectIdBefore = objectIdBefore.substring(0, 7);
touchAndSubmit(null);
- selectNode(tree, useRemote, false);
+ SWTBotTree updatedTree = getOrOpenView().bot().tree();
+ updatedTree.select(0);
+ selectNode(updatedTree, useRemote, false);
- runPush(tree);
+ runPush(updatedTree);
confirmed = bot.shell(dialogTitle);
treeItems = confirmed.bot().tree().getAllItems();
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 155fd1843e..d47ecb4bc5 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
@@ -419,19 +419,19 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
SWTBotTree tree = getOrOpenView().bot().tree();
myRepoViewUtil.getRootItem(tree, repositoryFile).select();
// the selection should be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
// the selection should be still be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
// activate the link with selection
toggleLinkWithSelection();
// the selection should be still be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
// select again the project
projectExplorerTree = TestUtil.getExplorerTree();
@@ -664,4 +664,4 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
item = item.getNode(node).expand();
return item;
}
-} \ No newline at end of file
+}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
index 389cbea014..9b9089dce1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
@@ -99,8 +99,7 @@ public abstract class GitRepositoriesViewTestBase extends
final SWTBotTreeItem[] items = tree.getAllItems();
boolean found = false;
for (SWTBotTreeItem item : items) {
- if (item.getText().startsWith(
- repositoryDir.getParentFile().getName())) {
+ if (item.getText().contains(repositoryDir.getParentFile().getName())) {
found = true;
break;
}

Back to the top