You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/09/22 17:36:32 UTC

svn commit: r1388821 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java

Author: sebb
Date: Sat Sep 22 15:36:31 2012
New Revision: 1388821

URL: http://svn.apache.org/viewvc?rev=1388821&view=rev
Log:
LANG-799 - DateUtils#parseDate uses default locale; add Locale support
Parse German date with English Locale, specifying German Locale override

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java?rev=1388821&r1=1388820&r2=1388821&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Sat Sep 22 15:36:31 2012
@@ -1615,6 +1615,18 @@ public class DateUtilsTest {
         }
     }
     
+    // Parse German date with English Locale, specifying German Locale override
+    @Test
+    public void testLANG799_EN_WITH_DE_LOCALE() throws ParseException {
+        Locale dflt = Locale.getDefault();
+        Locale.setDefault(Locale.ENGLISH);
+        try {
+            DateUtils.parseDate("Mi, 09 Apr 2008 23:55:38 GMT", Locale.GERMAN, "EEE, dd MMM yyyy HH:mm:ss zzz");
+        } finally {
+            Locale.setDefault(dflt);            
+        }
+    }
+
     /**
      * Retrieves a non-system locale date pattern string and attempts
      * to use it.