Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-07 15:19:31 +0000
committerMichael Valenta2002-06-07 15:19:31 +0000
commit1952e3a5233d9650c886acac02f4e2b5257f619f (patch)
tree46165b355590b7a30f96e63d2b49b43f476b5533
parent45d38396b484f1c786a0f2f8d3b76d82eed34f59 (diff)
downloadeclipse.platform.team-1952e3a5233d9650c886acac02f4e2b5257f619f.tar.gz
eclipse.platform.team-1952e3a5233d9650c886acac02f4e2b5257f619f.tar.xz
eclipse.platform.team-1952e3a5233d9650c886acac02f4e2b5257f619f.zip
Added granularity customization and assert on waitI20020607a
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/repository.properties3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java7
3 files changed, 10 insertions, 2 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/repository.properties b/tests/org.eclipse.team.tests.cvs.core/repository.properties
index 997762eef..15f636660 100644
--- a/tests/org.eclipse.team.tests.cvs.core/repository.properties
+++ b/tests/org.eclipse.team.tests.cvs.core/repository.properties
@@ -7,4 +7,5 @@ standalone=false
initrepo=false
temp=C:\temp
rsh=rsh
-localRepo=false \ No newline at end of file
+localRepo=false
+waitFactor=5 \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
index 838b0cf65..d6850bc89 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
@@ -25,6 +25,7 @@ public class CVSTestSetup extends TestSetup {
public static final boolean DEBUG;
public static final boolean LOCAL_REPO;
public static final String RSH;
+ public static final int WAIT_FACTOR;
public static CVSRepositoryLocation repository;
@@ -36,6 +37,7 @@ public class CVSTestSetup extends TestSetup {
DEBUG = Boolean.valueOf(System.getProperty("eclipse.cvs.debug", "false")).booleanValue();
RSH = System.getProperty("eclipse.cvs.rsh", "rsh");
LOCAL_REPO = Boolean.valueOf(System.getProperty("eclipse.cvs.localRepo", "false")).booleanValue();
+ WAIT_FACTOR = Integer.parseInt(System.getProperty("eclipse.cvs.waitFactor", "1"));
}
public static void loadProperties() {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
index e95010864..cf1eba30f 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
@@ -299,7 +299,12 @@ public abstract class JUnitTestCase extends TestCase {
*/
public static void waitMsec(int msec) {
try {
- Thread.currentThread().sleep(msec);
+ int wait = CVSTestSetup.WAIT_FACTOR * msec;
+ long start = System.currentTimeMillis();
+ Thread.currentThread().sleep(wait);
+ long end = System.currentTimeMillis();
+ // Allow a 100 ms error in waiting
+ assertTrue("Error in thread class. Did not wait long enough", (end - start) > (wait - 100));
} catch(InterruptedException e) {
fail("wait-problem");
}

Back to the top