db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r930177 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Fri, 02 Apr 2010 06:52:38 GMT
Author: kahatlen
Date: Fri Apr  2 06:52:38 2010
New Revision: 930177

URL: http://svn.apache.org/viewvc?rev=930177&view=rev
Log:
DERBY-4604: test lang.CollationTest.testSwedishCaseInsensitiveCollation fails with IBM's weme6.2/1.4.2.
& Sun's 1.4.2

Disable test case when the JVM suffers from this bug:
http://bugs.sun.com/view_bug.do?bug_id=4804273

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?rev=930177&r1=930176&r2=930177&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Fri Apr  2 06:52:38 2010
@@ -1394,12 +1394,30 @@ public void testMissingCollatorSupport()
         if(french) {
             suite.addTest(collatedSuite("fr", false, "testFrenchCollation"));
         }
-        if(swedish) {
+        if(swedish && !hasBuggySwedishLocale()) {
             suite.addTest(collatedSuite("sv", true, "testSwedishCaseInsensitiveCollation"));
         }
         return suite;
     }
 
+    /**
+     * Check whether the JVM suffers from this bug:
+     * http://bugs.sun.com/view_bug.do?bug_id=4804273
+     * If it does, the tests that use Swedish locale will fail.
+     *
+     * @return true if the bug is present, false otherwise
+     */
+    private static boolean hasBuggySwedishLocale() {
+        Collator c = Collator.getInstance(new Locale("sv"));
+        if (c.compare("aa", "ab") < 0) {
+            // OK, aa should be less than ab with Swedish collation
+            return false;
+        } else {
+            // this is a bug
+            return true;
+        }
+    }
+
   /**
      Load the appropriate driver for the current framework
    */



Mime
View raw message