Revision: 1889
          http://svn.sourceforge.net/vexi/?rev=1889&view=rev
Author:   mkpg2
Date:     2007-06-28 10:25:18 -0700 (Thu, 28 Jun 2007)

Log Message:
-----------
Reorganising test util code a little.

Modified Paths:
--------------
    core/trunk/org.vexi.core/src_junit/test/core/Util.java
    
core/trunk/org.vexi.core/src_junit/test/core/linenumbering/TestLineNumbering.java

Added Paths:
-----------
    core/trunk/org.ibex.js/src_junit/test/js/Util.java

Added: core/trunk/org.ibex.js/src_junit/test/js/Util.java
===================================================================
--- core/trunk/org.ibex.js/src_junit/test/js/Util.java                          
(rev 0)
+++ core/trunk/org.ibex.js/src_junit/test/js/Util.java  2007-06-28 17:25:18 UTC 
(rev 1889)
@@ -0,0 +1,31 @@
+package test.js;
+
+import java.io.File;
+
+public class Util {
+
+       static public File createTmpDir(){
+               File tempDir = new File("_temp_");
+               tempDir.mkdir();
+               return tempDir;
+       }
+
+       // Deletes all files and subdirectories under dir.
+       // Returns true if all deletions were successful.
+       // If a deletion fails, the method stops attempting to delete and 
returns false.
+       public 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();
+       }       
+       
+}

Modified: core/trunk/org.vexi.core/src_junit/test/core/Util.java
===================================================================
--- core/trunk/org.vexi.core/src_junit/test/core/Util.java      2007-06-28 
16:11:45 UTC (rev 1888)
+++ core/trunk/org.vexi.core/src_junit/test/core/Util.java      2007-06-28 
17:25:18 UTC (rev 1889)
@@ -29,10 +29,12 @@
        }
        
        static public File createTmpDir(){
-               File tempDir = new File("_temp_");
-               tempDir.mkdir();
-               return tempDir;
+               return test.js.Util.createTmpDir();
        }
+       
+       public static boolean deleteDir(File dir) {
+               return test.js.Util.deleteDir(dir);
+       }
        /*
        public static JS callStatic(Vexi v, String template, String attribute, 
JS[] args) throws JSExn {
                JS function = getStatic(v,template,attribute);

Modified: 
core/trunk/org.vexi.core/src_junit/test/core/linenumbering/TestLineNumbering.java
===================================================================
--- 
core/trunk/org.vexi.core/src_junit/test/core/linenumbering/TestLineNumbering.java
   2007-06-28 16:11:45 UTC (rev 1888)
+++ 
core/trunk/org.vexi.core/src_junit/test/core/linenumbering/TestLineNumbering.java
   2007-06-28 17:25:18 UTC (rev 1889)
@@ -46,7 +46,7 @@
        
        public void run(TestResult result) {
                super.run(result);
-               deleteDir(tempDir);
+               Util.deleteDir(tempDir);
        }
        
        public String[] getResourceDirs() {
@@ -81,22 +81,6 @@
                bw.close();
        }
        
-       // Deletes all files and subdirectories under dir.
-       // Returns true if all deletions were successful.
-       // If a deletion fails, the method stops attempting to delete and 
returns false.
-       public 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();
-       }       
+
        
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to