Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-06-30 21:52:21 +0000
committerAndrey Loskutov2015-06-30 21:52:21 +0000
commitc068a9559469da994061fd9cf574e69187b118aa (patch)
tree7887cba6e4463268a636ba7cc84f8f732e60310e /org.eclipse.egit.ui.test
parentfc63f87d88fc76071992042cb375b838d4ea3215 (diff)
downloadegit-c068a9559469da994061fd9cf574e69187b118aa.tar.gz
egit-c068a9559469da994061fd9cf574e69187b118aa.tar.xz
egit-c068a9559469da994061fd9cf574e69187b118aa.zip
Test fixes: ReplaceActionsTest, SynchronizeViewWorkspaceModelTest
Still trying to fix unstable tests... Change-Id: I92aa2168c8d9d652eb37da6f189c401d0733989b Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java8
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java2
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java7
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java2
4 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
index f58929c63b..3b25eec6b6 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
@@ -244,7 +244,7 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
if (firstProject.exists()) {
firstProject.delete(true, null);
- TestUtil.waitForJobs(50, 5000);
+ TestUtil.waitForJobs(100, 5000);
}
IProjectDescription desc = ResourcesPlugin.getWorkspace()
.newProjectDescription(PROJ1);
@@ -274,7 +274,7 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
if (secondProject.exists()) {
secondProject.delete(true, null);
- TestUtil.waitForJobs(50, 5000);
+ TestUtil.waitForJobs(100, 5000);
}
desc = ResourcesPlugin.getWorkspace().newProjectDescription(PROJ2);
@@ -332,9 +332,11 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
RepositoryProvider provider = RepositoryProvider.getProvider(project,
GitProvider.ID);
if (provider == null) {
- TestUtil.waitForJobs(100, 5000);
+ TestUtil.waitForJobs(500, 10000);
provider = RepositoryProvider.getProvider(project, GitProvider.ID);
}
+ assertTrue("Project is not accessible: " + project,
+ project.isAccessible());
assertNotNull("GitProvider not mapped to: " + project, provider);
GitProjectData data = ((GitProvider) provider).getData();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index d31ba4db8a..fa28ef2eab 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -167,7 +167,7 @@ public class TestUtil {
public static void joinJobs(Object family) throws InterruptedException {
// join() returns immediately if the job is not yet scheduled.
// To avoid unstable tests, let us first wait some time
- TestUtil.waitForJobs(50, 1000);
+ TestUtil.waitForJobs(100, 1000);
Job.getJobManager().join(family, null);
TestUtil.processUIEvents();
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
index b60fe7189b..acd81f9388 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
@@ -89,6 +89,8 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
git.merge().include(sideCommit).call();
+ TestUtil.waitForJobs(100, 5000);
+
String contentAfterMerge = getTestFileContent();
assertEquals("side", contentAfterMerge);
@@ -101,6 +103,8 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
.shell(UIText.CommitSelectDialog_WindowTitle);
assertEquals(2, selectDialog.bot().table().rowCount());
selectDialog.close();
+ TestUtil.processUIEvents();
+
// we have closed, so nothing should have changed
String contentAfterClose = getTestFileContent();
assertEquals(contentAfterMerge, contentAfterClose);
@@ -108,12 +112,15 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
clickReplaceWith(menuLabel);
bot.shell(UIText.DiscardChangesAction_confirmActionTitle).bot()
.button(IDialogConstants.OK_LABEL).click();
+ TestUtil.waitForJobs(100, 5000);
+
selectDialog = bot.shell(UIText.CommitSelectDialog_WindowTitle);
// Select first parent, which should be the master commit
SWTBotTable table = selectDialog.bot().table();
assertEquals("Master commit", table.cell(0, 1));
table.select(0);
executeReplace(selectDialog);
+ TestUtil.waitForJobs(100, 5000);
String replacedContent = getTestFileContent();
assertThat(replacedContent, not(contentAfterMerge));
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
index aabc705e70..e22aa30330 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
@@ -201,7 +201,7 @@ public abstract class AbstractSynchronizeViewTest extends
if (firstProject.exists()) {
firstProject.delete(true, null);
- TestUtil.waitForJobs(50, 5000);
+ TestUtil.waitForJobs(100, 5000);
}
IProjectDescription desc = ResourcesPlugin.getWorkspace()
.newProjectDescription(EMPTY_PROJECT);

Back to the top