camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1152564 - in /camel/trunk/components: camel-test/src/main/java/org/apache/camel/test/TestSupport.java camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java
Date Sun, 31 Jul 2011 11:40:37 GMT
Author: davsclaus
Date: Sun Jul 31 11:40:37 2011
New Revision: 1152564

URL: http://svn.apache.org/viewvc?rev=1152564&view=rev
Log:
CAMEL-4275: camel test kit, deleteDirectory will not fail if deleting of files failed.

Modified:
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
    camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java?rev=1152564&r1=1152563&r2=1152564&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
(original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
Sun Jul 31 11:40:37 2011
@@ -427,7 +427,10 @@ public abstract class TestSupport extend
                 deleteDirectory(files[i]);
             }
         }
-        file.delete();
+
+        if (file.isFile() && file.exists()) {
+            assertTrue("Deletion of file: " + file.getAbsolutePath() + " failed", file.delete());
+        }
     }
 
     /**

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java?rev=1152564&r1=1152563&r2=1152564&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
(original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
Sun Jul 31 11:40:37 2011
@@ -416,7 +416,10 @@ public abstract class TestSupport extend
                 deleteDirectory(files[i]);
             }
         }
-        file.delete();
+
+        if (file.isFile() && file.exists()) {
+            assertTrue("Deletion of file: " + file.getAbsolutePath() + " failed", file.delete());
+        }
     }
 
     /**

Modified: camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java?rev=1152564&r1=1152563&r2=1152564&view=diff
==============================================================================
--- camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java
(original)
+++ camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java
Sun Jul 31 11:40:37 2011
@@ -406,7 +406,10 @@ public abstract class TestSupport extend
                 deleteDirectory(files[i]);
             }
         }
-        file.delete();
+
+        if (file.isFile() && file.exists()) {
+            assertTrue(file.delete(), "Deletion of file: " + file.getAbsolutePath() + " failed");
+        }
     }
 
     /**



Mime
View raw message