You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by sy...@apache.org on 2003/04/06 13:44:05 UTC
cvs commit: avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test FileSourceTestCase.java
sylvain 2003/04/06 04:44:05
Modified: sourceresolve/src/test/org/apache/excalibur/source/test
FileSourceTestCase.java
Log:
Update testAtomicUpdate that is "too fast" compared to real situations
Revision Changes Path
1.2 +10 -3 avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test/FileSourceTestCase.java
Index: FileSourceTestCase.java
===================================================================
RCS file: /home/cvs/avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test/FileSourceTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FileSourceTestCase.java 4 Apr 2003 16:36:52 -0000 1.1
+++ FileSourceTestCase.java 6 Apr 2003 11:44:05 -0000 1.2
@@ -242,8 +242,15 @@
SourceValidity validity = child.getValidity();
assertEquals("Validity is not valid", 1, validity.isValid());
- // Wait a bit, otherwise the update speed is faster than the clock resolution
- Thread.sleep(100L);
+ // Wait a bit, otherwise the update speed is faster than the clock resolution.
+ // In real situations, this shouldn't be a problem, since it is very
+ // unlikely for a file to be modified twice and validity checked in such a
+ // small delay
+ long time = System.currentTimeMillis();
+ do
+ {
+ Thread.sleep(100L);
+ } while (System.currentTimeMillis() <= time);
// Now change its content
PrintWriter pw = new PrintWriter(child.getOutputStream());
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org