CVS Doc + Test Changes
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseRunnable.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseRunnable.java
new file mode 100644
index 0000000..6eca0fc
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseRunnable.java
@@ -0,0 +1,31 @@
+package org.eclipse.team.tests.ccvs.core;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ui.TeamOperation;
+
+public class EclipseRunnable implements Runnable {
+ private TeamOperation op;
+ private Exception ex;
+ private IProgressMonitor monitor;
+
+ public EclipseRunnable(TeamOperation op, IProgressMonitor monitor) {
+ this.monitor = monitor;
+ this.op = op;
+ }
+
+ public void run() {
+ try {
+ op.run(monitor);
+ } catch (InvocationTargetException e) {
+ ex = e;
+ } catch (InterruptedException e) {
+ ex = e;
+ }
+ }
+
+ public Exception getException(){
+ return ex;
+ }
+}
\ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index c2f6880..ecc7d1a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -987,15 +987,20 @@
}
});
}
-
- protected static void executeHeadless(TeamOperation op) throws CVSException {
+
+ protected static void executeHeadless(final TeamOperation op) throws CVSException {
try {
- try {
- // Bypass contxt by executing run(IProgressMonitor) directly
- op.run(DEFAULT_MONITOR);
- } catch (InvocationTargetException e1) {
- throw CVSException.wrapException(e1);
- }
+ EclipseRunnable tempRunnable = new EclipseRunnable(op, DEFAULT_MONITOR);
+ Thread tempThread = new Thread(tempRunnable);
+ tempThread.start();
+ while (tempThread.isAlive()){
+ Thread.sleep(100);
+ while (Display.getCurrent().readAndDispatch()) {};
+ }
+ //check for errors
+ Exception ex = tempRunnable.getException();
+ if (ex instanceof InvocationTargetException)
+ throw CVSException.wrapException(ex);
} catch (InterruptedException e) {
throw new OperationCanceledException();
}