harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r560058 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/io/File.java test/api/common/tests/api/java/io/FileTest.java
Date Fri, 27 Jul 2007 01:51:38 GMT
Author: leoli
Date: Thu Jul 26 18:51:37 2007
New Revision: 560058

URL: http://svn.apache.org/viewvc?view=rev&rev=560058
Log:
Apply patch for HARMONY-4493([classlib][EUT] jdtcoremodel suite is blocked because ClasspathTests.testEncoding
cannot remove unicode dir).

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?view=diff&rev=560058&r1=560057&r2=560058
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Thu Jul 26
18:51:37 2007
@@ -873,7 +873,8 @@
         }
         String result[] = new String[implList.length];
         for (int index = 0; index < implList.length; index++) {
-            result[index] = Util.toString(implList[index]);
+            result[index] = Util.toUTF8String(implList[index]);
+            //result[index] = Util.toString(implList[index]);
         }
         return result;
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/FileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/FileTest.java?view=diff&rev=560058&r1=560057&r2=560058
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/FileTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/FileTest.java
Thu Jul 26 18:51:37 2007
@@ -2267,6 +2267,31 @@
         assertEquals(String.class, objectStreamField.getType());
     }
     
+    //Regression test for HARMONY-4493
+    public void test_list_withUnicodeFileName() throws Exception {
+        File rootDir = new File("P");
+        if (!rootDir.exists()) {
+            rootDir.mkdir();
+            rootDir.deleteOnExit();
+        }
+
+        String dirName = new String("src\u3400");
+        File dir = new File(rootDir, dirName);
+        if (!dir.exists()) {
+            dir.mkdir();
+            dir.deleteOnExit();
+        }
+        boolean exist = false;
+        String[] fileNames = rootDir.list();
+        for (String fileName : fileNames) {
+            if (dirName.equals(fileName)) {
+                exist = true;
+                break;
+            }
+        }
+        assertTrue(exist);
+    }
+    
 	/**
 	 * Sets up the fixture, for example, open a network connection. This method
 	 * is called before a test is executed.



Mime
View raw message