Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 24285 invoked from network); 30 Oct 2006 03:37:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 03:37:31 -0000 Received: (qmail 15052 invoked by uid 500); 30 Oct 2006 03:37:42 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 15026 invoked by uid 500); 30 Oct 2006 03:37:42 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 15015 invoked by uid 99); 30 Oct 2006 03:37:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 19:37:42 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 19:37:30 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id CA0861A9846; Sun, 29 Oct 2006 19:37:07 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: harmony-commits@incubator.apache.org From: smishura@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061030033707.CA0861A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); } }