Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-11-14 17:44:53 +0000
committerMichael Valenta2003-11-14 17:44:53 +0000
commit604ad8d8a843485c9f930342b142fc6ab38cb49f (patch)
treef58490396af4c98d45945919c1224a1c52a273b9 /tests/org.eclipse.team.tests.cvs.core
parent854402af1dee795d9bbc90487384f71a9a6c7771 (diff)
downloadeclipse.platform.team-604ad8d8a843485c9f930342b142fc6ab38cb49f.tar.gz
eclipse.platform.team-604ad8d8a843485c9f930342b142fc6ab38cb49f.tar.xz
eclipse.platform.team-604ad8d8a843485c9f930342b142fc6ab38cb49f.zip
*** empty log message ***
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java33
1 files changed, 33 insertions, 0 deletions
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 014358ae6..0609b1abf 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
@@ -22,6 +22,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.*;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
+import org.eclipse.team.internal.ccvs.core.connection.CVSCommunicationException;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.resources.*;
@@ -741,5 +742,37 @@ public class EclipseTest extends EclipseWorkspaceTest {
}
}
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#runBare()
+ */
+ public void runBare() throws Throwable {
+ try {
+ super.runBare();
+ } catch (CVSException e) {
+ // If a communication exception occurred
+ // perhaps it is a server problem
+ // Try again, just in case it is
+ if (containsCommunicationException(e)) {
+ super.runBare();
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ private boolean containsCommunicationException(CVSException e) {
+ if (e instanceof CVSCommunicationException) return true;
+ IStatus status = e.getStatus();
+ if (status.getException() instanceof CVSCommunicationException) return true;
+ if (status.isMultiStatus()) {
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ if (child.getException() instanceof CVSCommunicationException) return true;
+ }
+ }
+ return false;
+ }
+
}

Back to the top