>
> http://svn.apache.org/viewcvs.cgi?rev=369049&view=rev
> http://issues.apache.org/bugzilla/show_bug.cgi?id=38130
>
> Maybe theres an issue with the patch I submitted - could you post the
> results of the tests without your change to add a sec?
>
> Niall
Reverting the spin() change, I get
Testcase: testAgeFilter(org.apache.commons.io.filefilter.FileFilterTestCase):
FAILED
Filter(File) org.apache.commons.io.filefilter.AgeFileFilter not false
for /home/phil/trunks-proper/io/test/io/new.txt
junit.framework.AssertionFailedError: Filter(File)
org.apache.commons.io.filefilter.AgeFileFilter not false for
/home/phil/trunks-proper/io/test/io/new.txt
at
org.apache.commons.io.filefilter.FileFilterTestCase.assertFiltering(FileFilterTestCase.java:60)
at
org.apache.commons.io.filefilter.FileFilterTestCase.testAgeFilter(FileFilterTestCase.java:491)
blah blah
The first failure is the first of the following lines in testAgeFilter,
all of which fail
assertFiltering(filter1, newFile, false);
assertFiltering(filter2, newFile, false);
assertFiltering(filter3, newFile, true);
assertFiltering(filter4, newFile, false);
assertFiltering(filter5, newFile, false);
assertFiltering(filter6, newFile, true);
assertFiltering(filter7, newFile, false);
assertFiltering(filter8, newFile, false);
assertFiltering(filter9, newFile, true);
When I do the this:
+++ src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java (working
copy)
@@ -462,7 +462,9 @@
File oldFile = new File(getTestDirectory(), "old.txt");
createFile(oldFile, 0);
spin(oldFile.lastModified());
+ System.out.println("oldFile.lastModified(): " +
oldFile.lastModified());
long now = System.currentTimeMillis();
+ System.out.println("now: " + now);
IOFileFilter filter1 = FileFilterUtils.ageFileFilter(now);
IOFileFilter filter2 = FileFilterUtils.ageFileFilter(now, true);
IOFileFilter filter3 = FileFilterUtils.ageFileFilter(now, false);
@@ -472,12 +474,14 @@
IOFileFilter filter6 = FileFilterUtils.ageFileFilter(date, false);
File reference = new File(getTestDirectory(), "reference.txt");
createFile(reference, 0);
+ System.out.println("reference.lastModified(): " +
reference.lastModified());
IOFileFilter filter7 = FileFilterUtils.ageFileFilter(reference);
IOFileFilter filter8 = FileFilterUtils.ageFileFilter(reference, true);
IOFileFilter filter9 = FileFilterUtils.ageFileFilter(reference, false);
spin(reference.lastModified());
File newFile = new File(getTestDirectory(), "new.txt");
createFile(newFile, 0);
+ System.out.println("newFile.lastModified(): " +
newFile.lastModified());
I get this to the console:
oldFile.lastModified(): 1141618573000
now: 1141618573368
reference.lastModified(): 1141618573000
newFile.lastModified(): 1141618573000
Does not look correct to me, given the sequence. Making spin wait a
full second changes this to:
oldFile.lastModified(): 1141618907000
now: 1141618908002
reference.lastModified(): 1141618908000
newFile.lastModified(): 1141618909000
and the tests pass. Could be I am missing something or there is
something funny going on with the .lastModified impl.
Phil
>
> > Phil
> >
> > On 3/4/06, Phil Steitz <[EMAIL PROTECTED]> wrote:
> > > Works4me on RH FC 2, with both Kb and original method returning kbytes.
> > >
> > > Looks like there is a cut and paste error in the javadoc for the new
> > > method, though. The "Kb" seems to be missing from the examples.
> > >
> > > I am also getting test failures for the FileFilterTestCase. The
> > > newfile tests are failing. I will look at this some more.
> > >
> > > Phil
> > >
> > > On 3/4/06, Stephen Colebourne <[EMAIL PROTECTED]> wrote:
> > > > If anyone has the ability to test FileSystemUtils.freeSpaceKb() on boxes
> > > > other than WindowsXP I'd like to know if the results tally what you'd
> > > > expect by calling dir/df directly.
> > > >
> > > > thanks
> > > > Stephen
> > > >
> > > >
> > > > [EMAIL PROTECTED] wrote:
> > > > > http://issues.apache.org/bugzilla/show_bug.cgi?id=38574
> > > > > ------- Additional Comments From [EMAIL PROTECTED] 2006-03-04 20:16
> > > > > -------
> > > > > FileSystemUtils.freeSpaceKb(drive)
> > > > > New method that unifies result to be in kilobytes
> > > > >
> > > > > Please reopen if you believe that the new method returns the wrong
> > > > > result (I can
> > > > > on test on Windows)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]