New test to make sure we detect file changes with earlier lastmodified.
Xavier Ducrohet [Fri, 8 Feb 2013 01:44:10 +0000 (17:44 -0800)]
Change-Id: Ie6dd18d8e8080c9faa1799253f027e935dc381aa

builder/src/test/java/com/android/builder/internal/incremental/FileManagerTest.java
builder/src/test/resources/testData/changeManager/files.data
builder/src/test/resources/testData/changeManager/files/untouched_date_after.png [copied from builder/src/test/resources/testData/changeManager/files/untouched_date_changed.png with 100% similarity]
builder/src/test/resources/testData/changeManager/files/untouched_date_before.png [moved from builder/src/test/resources/testData/changeManager/files/untouched_date_changed.png with 100% similarity]

index 02b79c1..4492b50 100644 (file)
@@ -42,12 +42,23 @@ public class FileManagerTest extends TestCase {
         assertNull(status);
     }
 
-    public void testUntouchedDateChanged() throws Exception {
+    public void testUntouchedDateBefore() throws Exception {
         FileManager fileManager = getFileManager();
         Map<File, FileStatus> changedFiles = fileManager.getChangedFiles();
 
-        File file = new File(sFilesFolder, "untouched_date_changed.png");
+        File file = new File(sFilesFolder, "untouched_date_before.png");
         FileStatus status = changedFiles.get(file);
+        // no change
+        assertNull(status);
+    }
+
+    public void testUntouchedDateAfter() throws Exception {
+        FileManager fileManager = getFileManager();
+        Map<File, FileStatus> changedFiles = fileManager.getChangedFiles();
+
+        File file = new File(sFilesFolder, "untouched_date_after.png");
+        FileStatus status = changedFiles.get(file);
+        // no change
         assertNull(status);
     }
 
index f91a8ff..54993b1 100644 (file)
@@ -1,7 +1,8 @@
 # golden files created manually to differ from the actual
 # files in key ways to test various detectors.
 $lm_untouched$ 98 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$untouched.png
-1000000000000 98 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$untouched_date_changed.png
-1000000000000 98 0000000000000000000000000000000000000000 $TOP$$SEP$content_changed.png
-1000000000000 95 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$size_changed.png
-1000000000000 2574 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$removed.png
+1000000000000 98 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$untouched_date_before.png
+9999999999999 98 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$untouched_date_after.png
+9999999999999 98 0000000000000000000000000000000000000000 $TOP$$SEP$content_changed.png
+9999999999999 95 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$size_changed.png
+9999999999999 2574 272fbc249474f5c842db3c6273ca94e30e641d06 $TOP$$SEP$removed.png