Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test `testCompareNewWithOldAfterCopy` does not work on linux/unix unless a `Thread.sleep` is added before the file copying (see cbcf28c). This test does not work on windows neither, because it is based on apache commons `FileUtils.copyFile` which does not honor `preserveFileDate=false` on windows. The following test works on linux/unix but not on windows: ``` @test public void testLastModifiedAfterCopy() throws IOException { File existing = new FileSystemResource(FILE_PATH).getFile(); File temp = new File("target/temp.txt"); assertFalse(temp.exists()); FileUtils.copyFile(existing, temp, false); assertTrue(temp.lastModified() > existing.lastModified()); } ``` On windows, even though `preserveFileDate=false`, the last modification date of the copy is equal (ie preserved) to the one of the original file, which is not the case on linux/unix. Trying to use an alternative like `java.nio.file.Files#copy` does not work since it only offers the ability to either copy file attributes or replace the existing file (which is not the idea of this test). This test does not add any value and should have been removed since a long time (see TODO in 12d6613).
- Loading branch information