You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Adam Constabaris (JIRA)" <ji...@apache.org> on 2006/11/19 18:00:37 UTC
[jira] Created: (ABDERA-23) Lang unit tests fail on Linux w/ Sun
JDK
Lang unit tests fail on Linux w/ Sun JDK
----------------------------------------
Key: ABDERA-23
URL: http://issues.apache.org/jira/browse/ABDERA-23
Project: Abdera
Issue Type: Bug
Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
Reporter: Adam Constabaris
Priority: Minor
org.apache.abdera.test.iri.TestLang includes (implicitly) tests for the locale parsing routine initLocale() in org.apache.abdera.util.lang.Lang, but those tests check that the calculated Locale yields up certain hardcoded values that don't match the results obtained in the above environment. This issue appears to affect both trunk and the .20 branch.
Using new Locale("en", "US", ca") on Sun 1.5 and 1.6 JREs for Linux yields "US" for displayCountry, while the existing test checks for equality with the literal value "United States".
Proposed fix: it seems that the desired behavior is really that the intiLocale() method yield up the right Locale. A patch that appears to address the issue follows:
Index: TestLang.java
===================================================================
--- TestLang.java (revision 476614)
+++ TestLang.java (working copy)
@@ -17,6 +17,7 @@
*/
package org.apache.abdera.test.iri;
+import java.util.Locale;
import org.apache.abdera.util.lang.InvalidLangTagSyntax;
import org.apache.abdera.util.lang.Lang;
@@ -27,15 +28,17 @@
public static void testLang() throws Exception {
Lang lang = new Lang("en-US-ca");
-
+ Locale testLocale = new Locale("en", "US", "ca");
+
assertEquals(lang.getPrimary(),"en");
assertEquals(lang.getSubtag(0),"US");
assertEquals(lang.getSubtag(1),"ca");
- assertEquals(lang.getLocale().toString(), "en_US_ca");
- assertEquals(lang.getLocale().getDisplayCountry(), "United States");
- assertEquals(lang.getLocale().getDisplayLanguage(), "English");
-
+ assertEquals( testLocale, lang.getLocale() );
+ assertEquals(testLocale.toString(), lang.getLocale().toString());
+ assertEquals(testLocale.getDisplayCountry(), lang.getLocale().getDisplayCountry());
+ assertEquals(testLocale.getDisplayLanguage(), lang.getLocale().getDisplayLanguage());
+ assertEquals( testLocale.getDisplayVariant(), lang.getLocale().getDisplayVariant());
assertTrue(lang.matches("*"));
assertTrue(lang.matches("en"));
assertTrue(lang.matches("EN"));
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Created: (ABDERA-23) Lang unit tests fail on Linux w/
Sun JDK
Posted by James M Snell <ja...@gmail.com>.
Patch applied. Thanks Adam!
- James
Adam Constabaris (JIRA) wrote:
> Lang unit tests fail on Linux w/ Sun JDK
> ----------------------------------------
>
> Key: ABDERA-23
> URL: http://issues.apache.org/jira/browse/ABDERA-23
> Project: Abdera
> Issue Type: Bug
> Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
> Reporter: Adam Constabaris
> Priority: Minor
>
> [snip]
[jira] Resolved: (ABDERA-23) Lang unit tests fail on Linux w/ Sun
JDK
Posted by "James M Snell (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/ABDERA-23?page=all ]
James M Snell resolved ABDERA-23.
---------------------------------
Resolution: Fixed
Assignee: James M Snell
Applied the patch to both trunk and 0.2.0. Please test and verify the fix.
> Lang unit tests fail on Linux w/ Sun JDK
> ----------------------------------------
>
> Key: ABDERA-23
> URL: http://issues.apache.org/jira/browse/ABDERA-23
> Project: Abdera
> Issue Type: Bug
> Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
> Reporter: Adam Constabaris
> Assigned To: James M Snell
> Priority: Minor
> Attachments: TestLang.patch
>
>
> org.apache.abdera.test.iri.TestLang includes (implicitly) tests for the locale parsing routine initLocale() in org.apache.abdera.util.lang.Lang, but those tests check that the calculated Locale yields up certain hardcoded values that don't match the results obtained in the above environment. This issue appears to affect both trunk and the .20 branch.
> Using new Locale("en", "US", ca") on Sun 1.5 and 1.6 JREs for Linux yields "US" for displayCountry, while the existing test checks for equality with the literal value "United States".
> Proposed fix: it seems that the desired behavior is really that the intiLocale() method yield up the right Locale. A patch that appears to address the issue follows:
> Index: TestLang.java
> ===================================================================
> --- TestLang.java (revision 476614)
> +++ TestLang.java (working copy)
> @@ -17,6 +17,7 @@
> */
> package org.apache.abdera.test.iri;
>
> +import java.util.Locale;
> import org.apache.abdera.util.lang.InvalidLangTagSyntax;
> import org.apache.abdera.util.lang.Lang;
>
> @@ -27,15 +28,17 @@
> public static void testLang() throws Exception {
>
> Lang lang = new Lang("en-US-ca");
> -
> + Locale testLocale = new Locale("en", "US", "ca");
> +
> assertEquals(lang.getPrimary(),"en");
> assertEquals(lang.getSubtag(0),"US");
> assertEquals(lang.getSubtag(1),"ca");
>
> - assertEquals(lang.getLocale().toString(), "en_US_ca");
> - assertEquals(lang.getLocale().getDisplayCountry(), "United States");
> - assertEquals(lang.getLocale().getDisplayLanguage(), "English");
> -
> + assertEquals( testLocale, lang.getLocale() );
> + assertEquals(testLocale.toString(), lang.getLocale().toString());
> + assertEquals(testLocale.getDisplayCountry(), lang.getLocale().getDisplayCountry());
> + assertEquals(testLocale.getDisplayLanguage(), lang.getLocale().getDisplayLanguage());
> + assertEquals( testLocale.getDisplayVariant(), lang.getLocale().getDisplayVariant());
> assertTrue(lang.matches("*"));
> assertTrue(lang.matches("en"));
> assertTrue(lang.matches("EN"));
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (ABDERA-23) Lang unit tests fail on Linux w/ Sun JDK
Posted by "James M Snell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-23?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James M Snell closed ABDERA-23.
-------------------------------
> Lang unit tests fail on Linux w/ Sun JDK
> ----------------------------------------
>
> Key: ABDERA-23
> URL: https://issues.apache.org/jira/browse/ABDERA-23
> Project: Abdera
> Issue Type: Bug
> Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
> Reporter: Adam Constabaris
> Assigned To: James M Snell
> Priority: Minor
> Attachments: TestLang.patch
>
>
> org.apache.abdera.test.iri.TestLang includes (implicitly) tests for the locale parsing routine initLocale() in org.apache.abdera.util.lang.Lang, but those tests check that the calculated Locale yields up certain hardcoded values that don't match the results obtained in the above environment. This issue appears to affect both trunk and the .20 branch.
> Using new Locale("en", "US", ca") on Sun 1.5 and 1.6 JREs for Linux yields "US" for displayCountry, while the existing test checks for equality with the literal value "United States".
> Proposed fix: it seems that the desired behavior is really that the intiLocale() method yield up the right Locale. A patch that appears to address the issue follows:
> Index: TestLang.java
> ===================================================================
> --- TestLang.java (revision 476614)
> +++ TestLang.java (working copy)
> @@ -17,6 +17,7 @@
> */
> package org.apache.abdera.test.iri;
>
> +import java.util.Locale;
> import org.apache.abdera.util.lang.InvalidLangTagSyntax;
> import org.apache.abdera.util.lang.Lang;
>
> @@ -27,15 +28,17 @@
> public static void testLang() throws Exception {
>
> Lang lang = new Lang("en-US-ca");
> -
> + Locale testLocale = new Locale("en", "US", "ca");
> +
> assertEquals(lang.getPrimary(),"en");
> assertEquals(lang.getSubtag(0),"US");
> assertEquals(lang.getSubtag(1),"ca");
>
> - assertEquals(lang.getLocale().toString(), "en_US_ca");
> - assertEquals(lang.getLocale().getDisplayCountry(), "United States");
> - assertEquals(lang.getLocale().getDisplayLanguage(), "English");
> -
> + assertEquals( testLocale, lang.getLocale() );
> + assertEquals(testLocale.toString(), lang.getLocale().toString());
> + assertEquals(testLocale.getDisplayCountry(), lang.getLocale().getDisplayCountry());
> + assertEquals(testLocale.getDisplayLanguage(), lang.getLocale().getDisplayLanguage());
> + assertEquals( testLocale.getDisplayVariant(), lang.getLocale().getDisplayVariant());
> assertTrue(lang.matches("*"));
> assertTrue(lang.matches("en"));
> assertTrue(lang.matches("EN"));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ABDERA-23) Lang unit tests fail on Linux w/ Sun
JDK
Posted by "Adam Constabaris (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/ABDERA-23?page=comments#action_12451305 ]
Adam Constabaris commented on ABDERA-23:
----------------------------------------
Works For Me(tm). Cheers.
> Lang unit tests fail on Linux w/ Sun JDK
> ----------------------------------------
>
> Key: ABDERA-23
> URL: http://issues.apache.org/jira/browse/ABDERA-23
> Project: Abdera
> Issue Type: Bug
> Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
> Reporter: Adam Constabaris
> Assigned To: James M Snell
> Priority: Minor
> Attachments: TestLang.patch
>
>
> org.apache.abdera.test.iri.TestLang includes (implicitly) tests for the locale parsing routine initLocale() in org.apache.abdera.util.lang.Lang, but those tests check that the calculated Locale yields up certain hardcoded values that don't match the results obtained in the above environment. This issue appears to affect both trunk and the .20 branch.
> Using new Locale("en", "US", ca") on Sun 1.5 and 1.6 JREs for Linux yields "US" for displayCountry, while the existing test checks for equality with the literal value "United States".
> Proposed fix: it seems that the desired behavior is really that the intiLocale() method yield up the right Locale. A patch that appears to address the issue follows:
> Index: TestLang.java
> ===================================================================
> --- TestLang.java (revision 476614)
> +++ TestLang.java (working copy)
> @@ -17,6 +17,7 @@
> */
> package org.apache.abdera.test.iri;
>
> +import java.util.Locale;
> import org.apache.abdera.util.lang.InvalidLangTagSyntax;
> import org.apache.abdera.util.lang.Lang;
>
> @@ -27,15 +28,17 @@
> public static void testLang() throws Exception {
>
> Lang lang = new Lang("en-US-ca");
> -
> + Locale testLocale = new Locale("en", "US", "ca");
> +
> assertEquals(lang.getPrimary(),"en");
> assertEquals(lang.getSubtag(0),"US");
> assertEquals(lang.getSubtag(1),"ca");
>
> - assertEquals(lang.getLocale().toString(), "en_US_ca");
> - assertEquals(lang.getLocale().getDisplayCountry(), "United States");
> - assertEquals(lang.getLocale().getDisplayLanguage(), "English");
> -
> + assertEquals( testLocale, lang.getLocale() );
> + assertEquals(testLocale.toString(), lang.getLocale().toString());
> + assertEquals(testLocale.getDisplayCountry(), lang.getLocale().getDisplayCountry());
> + assertEquals(testLocale.getDisplayLanguage(), lang.getLocale().getDisplayLanguage());
> + assertEquals( testLocale.getDisplayVariant(), lang.getLocale().getDisplayVariant());
> assertTrue(lang.matches("*"));
> assertTrue(lang.matches("en"));
> assertTrue(lang.matches("EN"));
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (ABDERA-23) Lang unit tests fail on Linux w/ Sun
JDK
Posted by "Adam Constabaris (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/ABDERA-23?page=all ]
Adam Constabaris updated ABDERA-23:
-----------------------------------
Attachment: TestLang.patch
Patch for org.apache.abdera.test.iri.TestLang in Abdera core
> Lang unit tests fail on Linux w/ Sun JDK
> ----------------------------------------
>
> Key: ABDERA-23
> URL: http://issues.apache.org/jira/browse/ABDERA-23
> Project: Abdera
> Issue Type: Bug
> Environment: Ubuntu Edgy, Sun JDK 1.5.0_08, and 1.6.0RC
> Reporter: Adam Constabaris
> Priority: Minor
> Attachments: TestLang.patch
>
>
> org.apache.abdera.test.iri.TestLang includes (implicitly) tests for the locale parsing routine initLocale() in org.apache.abdera.util.lang.Lang, but those tests check that the calculated Locale yields up certain hardcoded values that don't match the results obtained in the above environment. This issue appears to affect both trunk and the .20 branch.
> Using new Locale("en", "US", ca") on Sun 1.5 and 1.6 JREs for Linux yields "US" for displayCountry, while the existing test checks for equality with the literal value "United States".
> Proposed fix: it seems that the desired behavior is really that the intiLocale() method yield up the right Locale. A patch that appears to address the issue follows:
> Index: TestLang.java
> ===================================================================
> --- TestLang.java (revision 476614)
> +++ TestLang.java (working copy)
> @@ -17,6 +17,7 @@
> */
> package org.apache.abdera.test.iri;
>
> +import java.util.Locale;
> import org.apache.abdera.util.lang.InvalidLangTagSyntax;
> import org.apache.abdera.util.lang.Lang;
>
> @@ -27,15 +28,17 @@
> public static void testLang() throws Exception {
>
> Lang lang = new Lang("en-US-ca");
> -
> + Locale testLocale = new Locale("en", "US", "ca");
> +
> assertEquals(lang.getPrimary(),"en");
> assertEquals(lang.getSubtag(0),"US");
> assertEquals(lang.getSubtag(1),"ca");
>
> - assertEquals(lang.getLocale().toString(), "en_US_ca");
> - assertEquals(lang.getLocale().getDisplayCountry(), "United States");
> - assertEquals(lang.getLocale().getDisplayLanguage(), "English");
> -
> + assertEquals( testLocale, lang.getLocale() );
> + assertEquals(testLocale.toString(), lang.getLocale().toString());
> + assertEquals(testLocale.getDisplayCountry(), lang.getLocale().getDisplayCountry());
> + assertEquals(testLocale.getDisplayLanguage(), lang.getLocale().getDisplayLanguage());
> + assertEquals( testLocale.getDisplayVariant(), lang.getLocale().getDisplayVariant());
> assertTrue(lang.matches("*"));
> assertTrue(lang.matches("en"));
> assertTrue(lang.matches("EN"));
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira