harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r480070 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java
Date Tue, 28 Nov 2006 14:45:26 GMT
Author: pyang
Date: Tue Nov 28 06:45:25 2006
New Revision: 480070

URL: http://svn.apache.org/viewvc?view=rev&rev=480070
Log:
Revert the modification introduced by patch of HARMONY-2157([classlib][luni]not able to make
a directory whose length is greater than 248) and HARMONY-2270([classlib][unit] tests.api.java.io.FileTest@test_mkdir
failes on win XP), due to the patches caused VM crash on Windows sometimes

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java?view=diff&rev=480070&r1=480069&r2=480070
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java
Tue Nov 28 06:45:25 2006
@@ -1770,10 +1770,9 @@
 	}
 
 	/**
-	 * @throws IOException 
 	 * @tests java.io.File#mkdir()
 	 */
-	public void test_mkdir() throws IOException {
+	public void test_mkdir() {
 		// Test for method boolean java.io.File.mkdir()
 
 		String base = System.getProperty("user.dir");
@@ -1791,40 +1790,16 @@
 				dirExists = false;
 			}
 		}
-		
-		assertTrue("mkdir failed", dir.mkdir() && dir.exists());
-        dir.deleteOnExit();
-
-        // Test make a long path
-        String longDirName = "abcdefghijklmnopqrstuvwx";// 24 chars
-        StringBuilder sb = new StringBuilder(dir + File.separator);
-        StringBuilder sb2 = new StringBuilder(dir + File.separator);
-        while (dir.getCanonicalPath().length() < 256 - longDirName.length()) {
-            sb.append(longDirName + File.separator);
-            dir = new File(sb.toString());
-            assertTrue("mkdir failed", dir.mkdir() && dir.exists());
-            dir.deleteOnExit();
-        }
-        while (dir.getCanonicalPath().length() < 256) {
-            sb.append(0);
-            dir = new File(sb.toString());
-            assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",
-                    dir.mkdir() && dir.exists());
-            dir.deleteOnExit();
-        }
-        // Test make many paths
-        while (dir.getCanonicalPath().length() < 256) {
-            sb2.append(0);
-            dir = new File(sb2.toString());
-            assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",
-                    dir.mkdir() && dir.exists());
-            dir.deleteOnExit();
-        }
+		try {
+			assertTrue("mkdir failed", dir.mkdir() && dir.exists());
+		} finally {
+			dir.delete();
+		}
 	}
 
 	/**
-     * @tests java.io.File#mkdirs()
-     */
+	 * @tests java.io.File#mkdirs()
+	 */
 	public void test_mkdirs() {
 		// Test for method boolean java.io.File.mkdirs()
 



Mime
View raw message