You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2011/05/09 17:19:05 UTC

svn commit: r1101059 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java

Author: kahatlen
Date: Mon May  9 15:19:04 2011
New Revision: 1101059

URL: http://svn.apache.org/viewvc?rev=1101059&view=rev
Log:
DERBY-5222: Compatibility tests fail to delete database directory

Use BaseTestCase.removeDirectory() to delete the database directory so
that we get more details in the log when something goes wrong.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java?rev=1101059&r1=1101058&r2=1101059&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java Mon May  9 15:19:04 2011
@@ -1118,15 +1118,8 @@ public class CompatibilityCombinations e
         
         if ( removeDBfiles )
         {
-            File databaseDir = new File(fullPath);
-            if ( deleteDir(databaseDir) )
-            {
-                DEBUG("Successfully deleted database dir '" + fullPath +"'");
-            }
-            else
-            {
-                DEBUG("Failed deleting database dir '" + fullPath +"'");
-            }
+            DEBUG("Deleting database dir '" + fullPath + "'");
+            BaseTestCase.removeDirectory(fullPath);
         }
         else
         {
@@ -1419,25 +1412,6 @@ public class CompatibilityCombinations e
         DEBUG("");
     }
     
-    
-    private static boolean deleteDir(File dir)
-    {
-        if (dir.isDirectory())
-        {
-            String[] children = dir.list();
-            for (int i=0; i<children.length; i++)
-          {
-                boolean success = deleteDir(new File(dir, children[i]));
-                if (!success)
-                {
-                    return false;
-                }
-            }
-        }
-        
-        // The directory is now empty so delete it
-        return dir.delete();
-    }
     /////////////////////
     
   private static void processOutput(Process proc, PrintWriter out)