harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r469056 - /incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java
Date Mon, 30 Oct 2006 03:37:07 GMT
Author: smishura
Date: Sun Oct 29 19:37:07 2006
New Revision: 469056

URL: http://svn.apache.org/viewvc?view=rev&rev=469056
Log:
Apply patch for HARMONY-1893 ([test][swing] j.s.filechooser.FileSystemViewTest contains locale-dependent
tests)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java?view=diff&rev=469056&r1=469055&r2=469056
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java
Sun Oct 29 19:37:07 2006
@@ -57,11 +57,11 @@
     public void testIsRoot() throws Exception {
         assertFalse(view.isRoot(file));
         if (SystemUtils.getOS() == SystemUtils.OS_WINDOWS) {
-            assertTrue(view.getRoots().length == 1);
-            assertTrue(view.getRoots()[0].getName().equals("Desktop"));
+            assertEquals(1, view.getRoots().length);
+            assertNotEmpty(view.getRoots()[0].getName());
         } else if (SystemUtils.getOS() == SystemUtils.OS_LINUX) {
-            assertTrue(view.getRoots().length == 1);
-            assertTrue(view.getRoots()[0].getPath().equals("/"));
+            assertEquals(1, view.getRoots().length);
+            assertEquals("/", view.getRoots()[0].getPath());
         }
     }
 
@@ -88,15 +88,11 @@
 
     public void testGetSystemTypeDescription() throws Exception {
         file.createNewFile();
-        assertEquals("File", view.getSystemTypeDescription(file));
+        assertNotEmpty(view.getSystemTypeDescription(file));
 
         file.delete();
         file.mkdir();
-        if (SystemUtils.getOS() == SystemUtils.OS_WINDOWS) {
-            assertEquals("File Folder", view.getSystemTypeDescription(file));
-        } else {
-            assertEquals("Folder", view.getSystemTypeDescription(file));
-        }
+        assertNotEmpty(view.getSystemTypeDescription(file));
     }
 
     public void testGetRoot() throws Exception {
@@ -146,5 +142,10 @@
             f.delete();
             dir.delete();
         }
+    }
+
+    private static void assertNotEmpty(final String name) {
+        assertNotNull(name);
+        assertTrue("name is empty", name.length() > 0);
     }
 }



Mime
View raw message