Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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 af3e9c1605..9910b2884a 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