Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2016-10-26 09:06:52 -0400
committerAndrey Loskutov2016-10-26 09:56:04 -0400
commit0945d179855e62e9df200106a15fcad49ff3aa2f (patch)
treebbb499cbda95cf16edd169c96a5001da17a6e0a5 /org.eclipse.egit.core.test/src
parent1d7aa1e4b565d4983f33ec5b30cff23da47a8396 (diff)
downloadegit-0945d179855e62e9df200106a15fcad49ff3aa2f.tar.gz
egit-0945d179855e62e9df200106a15fcad49ff3aa2f.tar.xz
egit-0945d179855e62e9df200106a15fcad49ff3aa2f.zip
Trying to make repository tests more stable (disconnect process)
Bug: 506555 Change-Id: I4b4cf3cc71fcba34b858e47a499c4206deb17207 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.core.test/src')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
index af3e9c160..9910b2884 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
@@ -27,7 +27,11 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.op.BranchOperation;
@@ -533,14 +537,20 @@ public class TestRepository {
* Disconnects provider from project
*
* @param project
- * @throws CoreException
+ * @throws Exception
*/
- public void disconnect(IProject project) throws CoreException {
+ public void disconnect(IProject project) throws Exception {
Collection<IProject> projects = Collections.singleton(project
.getProject());
DisconnectProviderOperation disconnect = new DisconnectProviderOperation(
projects);
- disconnect.execute(null);
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
+ public void run(IProgressMonitor monitor) throws CoreException {
+ disconnect.execute(null);
+ }
+ }, project, IWorkspace.AVOID_UPDATE, null);
+ TestUtils.waitForJobs(5000, null);
}
public URIish getUri() throws URISyntaxException {

Back to the top