commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1242579 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
Date Thu, 09 Feb 2012 22:45:20 GMT
Author: ggregory
Date: Thu Feb  9 22:45:20 2012
New Revision: 1242579

URL: http://svn.apache.org/viewvc?rev=1242579&view=rev
Log:
Extract local variables (testSetLastModified) while looking for a fix for continuum build
failures.

Modified:
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java?rev=1242579&r1=1242578&r2=1242579&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
(original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
Thu Feb  9 22:45:20 2012
@@ -67,16 +67,18 @@ public class LastModifiedTests
             // Try a file
             final FileObject file = getReadFolder().resolveFile("file1.txt");
             file.getContent().setLastModifiedTime(now);
+            final double lastModTimeAccuracy = file.getFileSystem().getLastModTimeAccuracy();
+            final long lastModifiedTime = file.getContent().getLastModifiedTime();
             try
             {
-                assertEquals("Check 1", now, file.getContent().getLastModifiedTime(), file.getFileSystem().getLastModTimeAccuracy());
+                assertEquals("Check 1", now, lastModifiedTime, lastModTimeAccuracy);
             }
             catch (AssertionFailedError e)
             {
                 // on linux ext3 the above check is not necessarily true
-                if (file.getFileSystem().getLastModTimeAccuracy() < 1000L)
+                if (lastModTimeAccuracy < 1000L)
                 {
-                    assertEquals("Check 2", now, file.getContent().getLastModifiedTime(),
1000L);
+                    assertEquals("Check 2", now, lastModifiedTime, 1000L);
                 }
                 else
                 {
@@ -90,16 +92,18 @@ public class LastModifiedTests
             // Try a folder
             final FileObject folder = getReadFolder().resolveFile("dir1");
             folder.getContent().setLastModifiedTime(now);
+            final double lastModTimeAccuracy = folder.getFileSystem().getLastModTimeAccuracy();
+            final long lastModifiedTime = folder.getContent().getLastModifiedTime();
             try
             {
-                assertEquals("Check 3", now, folder.getContent().getLastModifiedTime(), folder.getFileSystem().getLastModTimeAccuracy());
+                assertEquals("Check 3", now, lastModifiedTime, lastModTimeAccuracy);
             }
             catch (AssertionFailedError e)
             {
                 // on linux ext3 the above check is not necessarily true
-                if (folder.getFileSystem().getLastModTimeAccuracy() < 1000L)
+                if (lastModTimeAccuracy < 1000L)
                 {
-                    assertEquals("Check 4", now, folder.getContent().getLastModifiedTime(),
1000L);
+                    assertEquals("Check 4", now, lastModifiedTime, 1000L);
                 }
                 else
                 {



Mime
View raw message