You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ni...@apache.org on 2010/10/09 03:09:26 UTC

svn commit: r1006091 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java

Author: niallp
Date: Sat Oct  9 01:09:25 2010
New Revision: 1006091

URL: http://svn.apache.org/viewvc?rev=1006091&view=rev
Log:
IO-161 Try to reduce test failures

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java?rev=1006091&r1=1006090&r2=1006091&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java Sat Oct  9 01:09:25 2010
@@ -155,7 +155,7 @@ public class FileCleaningTrackerTestCase
         pauseForDeleteToComplete(testFile.getParentFile());
         
         assertEquals(0, theInstance.getTrackCount());
-        assertEquals(showFailures(), false, testFile.exists());
+        assertEquals(showFailures(), false, new File(testFile.getPath()).exists());
         assertEquals(showFailures(), false, testFile.getParentFile().exists());
     }
 
@@ -283,10 +283,14 @@ public class FileCleaningTrackerTestCase
     }
 
     //-----------------------------------------------------------------------
-    private void pauseForDeleteToComplete(File file) throws Exception {
+    private void pauseForDeleteToComplete(File file) {
         int count = 0;
-        while(file.exists() && count++ < 20) {
-            Thread.sleep(500L);
+        while(file.exists() && count++ < 40) {
+            try {
+                Thread.sleep(500L);
+            } catch (InterruptedException e) {
+            }
+            file = new File(file.getPath());
         }
     }
     private String showFailures() throws Exception {