You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/10/30 04:37:07 UTC
svn commit: r469056 -
/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/filechooser/FileSystemViewTest.java
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);
}
}