cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jav...@apache.org
Subject svn commit: r1370695 - /cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java
Date Wed, 08 Aug 2012 08:20:50 GMT
Author: javier
Date: Wed Aug  8 08:20:49 2012
New Revision: 1370695

URL: http://svn.apache.org/viewvc?rev=1370695&view=rev
Log:
COCOON-2328: Update to handle JDK 1.7 special case

Modified:
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java?rev=1370695&r1=1370694&r2=1370695&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/acting/LocaleActionTestCase.java
Wed Aug  8 08:20:49 2012
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpSession;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.SitemapComponentTestCase;
 import org.apache.cocoon.environment.mock.MockSession;
+import org.apache.commons.lang.SystemUtils;
 
 /**
  * JUnit-based tests for {@link LocaleAction} class.
@@ -107,7 +108,13 @@ public class LocaleActionTestCase extend
         session.setAttribute("locale", "th_TH_TH");
         result = act("locale3", null, parameters);
         assertNotNull("Action should always succeed", result);
-        assertEquals("Test for locale", "th_TH_TH", result.get("locale"));
+        // see http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#special_cases_constructor
+        if(SystemUtils.isJavaVersionAtLeast(1.7f)) {
+            assertEquals("Test for locale", "th_TH_TH_#u-nu-thai", result.get("locale"));
+        } else {
+            assertEquals("Test for locale", "th_TH_TH", result.get("locale"));
+        }
+
         assertEquals("Test for language", "th", result.get("language"));
         assertEquals("Test for country", "TH", result.get("country"));
         assertEquals("Test for variant", "TH", result.get("variant"));



Mime
View raw message