sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1552063 - /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
Date Wed, 18 Dec 2013 19:11:34 GMT
Author: desruisseaux
Date: Wed Dec 18 19:11:34 2013
New Revision: 1552063

URL: http://svn.apache.org/r1552063
Log:
Added a test for IETF BCP 47 language tag string parsing.

Modified:
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java?rev=1552063&r1=1552062&r2=1552063&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
[UTF-8] Wed Dec 18 19:11:34 2013
@@ -74,13 +74,14 @@ public final strictfp class LocalesTest 
     @Test
     @DependsOnMethod("testUnique")
     public void testParse() {
+        assertSame(Locale.ENGLISH,       Locales.parse("en"));
         assertSame(Locale.FRENCH,        Locales.parse("fr"));
         assertSame(Locale.FRENCH,        Locales.parse("fra"));
         assertSame(Locale.CANADA_FRENCH, Locales.parse("fr_CA"));
         assertSame(Locale.CANADA_FRENCH, Locales.parse("fra_CA"));
         assertSame(Locale.CANADA_FRENCH, Locales.parse("fr_CAN"));
         assertSame(Locale.CANADA_FRENCH, Locales.parse("fra_CAN"));
-        assertSame(Locale.ENGLISH,       Locales.parse("en"));
+        assertSame(Locale.JAPAN,         Locales.parse("ja_JP"));
 
         assertEquals(new Locale("de", "DE"),            Locales.parse("de_DE"));
         assertEquals(new Locale("",   "GB"),            Locales.parse("_GB"));
@@ -89,6 +90,16 @@ public final strictfp class LocalesTest 
     }
 
     /**
+     * Tests the {@link Locales#parse(String)} method with a IETF BCP 47 language tag string.
+     * This functionality is supported only on the JDK7 branch.
+     */
+    @Test
+    public void testParseIETF() {
+        assertEquals(Locale.JAPAN, Locales.parse("ja-JP"));
+        assertEquals(new Locale("en", "US", "POSIX"), Locales.parse("en-US-x-lvariant-POSIX"));
+    }
+
+    /**
      * Tests that {@link Locales#parse(String)} throw an exception if given an invalid argument.
      */
     @Test



Mime
View raw message