Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-06-28 21:41:04 +0000
committerAndrey Loskutov2015-06-28 21:41:04 +0000
commit883d85fe75029415d1377686a06da7b116a7c0d5 (patch)
tree313c560240bb24337b0d8f7ae6213b5d65f1d806 /org.eclipse.egit.ui.test
parent4830faad99e65a6b5a495d5da6b560645658a88c (diff)
downloadegit-883d85fe75029415d1377686a06da7b116a7c0d5.tar.gz
egit-883d85fe75029415d1377686a06da7b116a7c0d5.tar.xz
egit-883d85fe75029415d1377686a06da7b116a7c0d5.zip
More test stability fixes after resource changes
Trying to fix instabilities in AbstractSynchronizeViewTest and LocalRepositoryTestCase, probably caused by inconsistent or not up-to-date resource model after resource modifications. Change-Id: I2003bcc7259623020adc5a6214ce36664e69aacc 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.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java14
2 files changed, 12 insertions, 6 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 b5131a36f2..9f9b690304 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
@@ -272,7 +272,6 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
.getPath()));
secondProject.create(desc, null);
secondProject.open(null);
- TestUtil.waitForJobs(100, 5000);
IFolder secondfolder = secondProject.getFolder(FOLDER);
secondfolder.create(false, true, null);
@@ -282,6 +281,9 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
IFile secondtextFile2 = secondfolder.getFile(FILE2);
secondtextFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
+
+ TestUtil.waitForJobs(100, 5000);
+
// TODO we should be able to hide the .project
// IFile gitignore = secondPoject.getFile(".gitignore");
// gitignore.create(new ByteArrayInputStream("/.project\n"
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 d2c72931ad..94b738f8fe 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
@@ -50,7 +50,6 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -59,6 +58,7 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.mapping.ITeamContentProviderDescriptor;
import org.eclipse.team.ui.mapping.ITeamContentProviderManager;
import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -86,16 +86,17 @@ public abstract class AbstractSynchronizeViewTest extends
@After
public void closeSynchronizeView() {
- SWTBotView syncView = bot.viewByTitle("Synchronize");
- syncView.close();
+ TestUtil.hideView(ISynchronizeView.VIEW_ID);
}
@After
public void deleteEmptyProject() throws Exception {
IProject prj = ResourcesPlugin.getWorkspace().getRoot()
.getProject(EMPTY_PROJECT);
- if (prj.exists())
+ if (prj.exists()) {
prj.delete(false, false, null);
+ TestUtil.waitForJobs(100, 5000);
+ }
}
@Before
@@ -196,8 +197,10 @@ public abstract class AbstractSynchronizeViewTest extends
IProject firstProject = ResourcesPlugin.getWorkspace().getRoot()
.getProject(EMPTY_PROJECT);
- if (firstProject.exists())
+ if (firstProject.exists()) {
firstProject.delete(true, null);
+ TestUtil.waitForJobs(100, 5000);
+ }
IProjectDescription desc = ResourcesPlugin.getWorkspace()
.newProjectDescription(EMPTY_PROJECT);
desc.setLocation(new Path(new File(myRepository.getWorkTree(),
@@ -213,6 +216,7 @@ public abstract class AbstractSynchronizeViewTest extends
IFile textFile2 = folder.getFile(FILE2);
textFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
+ TestUtil.waitForJobs(100, 5000);
new ConnectProviderOperation(firstProject, gitDir).execute(null);
}

Back to the top