You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2006/01/05 09:16:39 UTC

DO NOT REPLY [Bug 38130] New: - [io] Tests fail on Windows 2000 due to File lastModified() behaviour

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38130>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38130

           Summary: [io] Tests fail on Windows 2000 due to File
                    lastModified() behaviour
           Product: Commons
           Version: 1.1 Final
          Platform: Other
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: IO
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: niallp@apache.org


The following JUnit test cases fail when running on Windows 2000 (JDK 1.4.2_05)
      FileFilterTestCase
      FileUtilsFileNewerTestCase

According to the java.io.File javadoc for the setLastModified() method "All 
platforms support file-modification times to the nearest second, but some 
provide more precision"

http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#setLastModified(long)

1) FileFilterTestCase's testAgeFilter() method appears to be failing because 
the lastModified date is being rounded up to the nearest second - but the spin
() method is only waiting until the system time is later. I'm attaching a patch 
so that the spin() method waits until the system time is after the modification 
date/time of the file.

2) FileUtilsFileNewerTestCase seems to have a couple of problems:

* The testIsFileNewer() method appears to be failing because calling 
setLastModified() seems to be rounding up to the nearest two seconds, so the 
check on the temporary file lastModified time after it has been set fails. 
Changing testIsFileNewer() to use two seconds rather than one resolves this and 
I found the following bug which appears to back this up:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4697792

* The testIsFileNewerImaginaryFile() method appears to be failing because 
setting the lastModified to zero seems to be ignored. This is also mentioned in 
the above bug. Passing the actual temporary file's modifiedDate rather than 
zero resolves this.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38130] - [io] Tests fail on Windows 2000 due to File lastModified() behaviour

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38130>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38130





------- Additional Comments From niallp@apache.org  2006-01-05 09:17 -------
Created an attachment (id=17330)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17330&action=view)
Patch to fix the win2k issues in io tests


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38130] - [io] Tests fail on Windows 2000 due to File lastModified() behaviour

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38130>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38130


scolebourne@joda.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From scolebourne@joda.org  2006-01-14 18:00 -------
Patch applied, thanks

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org