You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2003/06/10 16:15:32 UTC
cvs commit: avalon-excalibur/sourceresolve/src/test/org/apache/excalibur/source/test FileSourceTestCase.java
bloritsch 2003/06/10 07:15:31
Modified: sourceresolve/src/test/org/apache/excalibur/source/test
FileSourceTestCase.java
Log:
Ensure that the time is properly tested, without any room for timing errors.
Revision Changes Path
1.4 +5 -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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FileSourceTestCase.java 7 Apr 2003 17:24:02 -0000 1.3
+++ FileSourceTestCase.java 10 Jun 2003 14:15:31 -0000 1.4
@@ -100,11 +100,13 @@
public void testDirExistence() throws Exception
{
+ m_tempDir.mkdirs();
+ long time = m_tempDir.lastModified();
FileSource src = new FileSource("file", m_tempDir);
assertTrue("Temp dir doesn't exist", src.exists());
assertTrue("Temp dir is not traversable", src.isCollection());
// Check it was created less than 1 secs ago
- assertEquals("Wrong creation date", System.currentTimeMillis() / 1000L, src.getLastModified() / 1000L);
+ assertEquals("Wrong creation date", time, src.getLastModified());
assertTrue("Temp dir is not empty", src.getChildren().isEmpty());
}
@@ -243,7 +245,7 @@
assertEquals("Validity is not valid", 1, validity.isValid());
// Wait 1 second before updating the file
- Thread.sleep(1000L);
+ Thread.sleep(2000L);
// 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