You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2015/05/01 22:08:39 UTC

[1/4] [lang] Set default locale to Locale.ENGLISH to make test independent from system default locale.

Repository: commons-lang
Updated Branches:
  refs/heads/master 775203dd2 -> 5c6a87c46


Set default locale to Locale.ENGLISH to make test independent from system default locale.


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/6dbb48c8
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/6dbb48c8
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/6dbb48c8

Branch: refs/heads/master
Commit: 6dbb48c8e685f65f45ad5df9f7684bed910036c8
Parents: 775203d
Author: Benedikt Ritter <br...@apache.org>
Authored: Fri May 1 22:04:48 2015 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Fri May 1 22:04:48 2015 +0200

----------------------------------------------------------------------
 .../commons/lang3/time/DateFormatUtilsTest.java | 28 ++++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/6dbb48c8/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
index 425ec6c..93acc35 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
@@ -166,17 +166,23 @@ public class DateFormatUtilsTest {
     }
 
     @Test
-    public void testSMTP(){
-        TimeZone timeZone = TimeZone.getTimeZone("GMT-3");
-        Calendar june = createJuneTestDate(timeZone);
-        
-        assertFormats("Sun, 08 Jun 2003 10:11:12 -0300", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
-                timeZone, june);
-
-        timeZone = TimeZone.getTimeZone("UTC");
-        june = createJuneTestDate(timeZone);
-        assertFormats("Sun, 08 Jun 2003 10:11:12 +0000", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
-                timeZone, june);
+    public void testSMTP() {
+        Locale defaultLocale = Locale.getDefault();
+        try {
+            Locale.setDefault(Locale.ENGLISH);
+            TimeZone timeZone = TimeZone.getTimeZone("GMT-3");
+            Calendar june = createJuneTestDate(timeZone);
+            
+            assertFormats("Sun, 08 Jun 2003 10:11:12 -0300", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
+                    timeZone, june);
+    
+            timeZone = TimeZone.getTimeZone("UTC");
+            june = createJuneTestDate(timeZone);
+            assertFormats("Sun, 08 Jun 2003 10:11:12 +0000", DateFormatUtils.SMTP_DATETIME_FORMAT.getPattern(),
+                    timeZone, june);
+        } finally {
+            Locale.setDefault(defaultLocale);
+        }
     }
 
     /*


[2/4] [lang] Format source code

Posted by br...@apache.org.
Format source code


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/260e0e0c
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/260e0e0c
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/260e0e0c

Branch: refs/heads/master
Commit: 260e0e0cd21af7b03ab0dae33b4978233db67773
Parents: 6dbb48c
Author: Benedikt Ritter <br...@apache.org>
Authored: Fri May 1 22:05:23 2015 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Fri May 1 22:05:23 2015 +0200

----------------------------------------------------------------------
 .../org/apache/commons/lang3/time/DateFormatUtilsTest.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/260e0e0c/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
index 93acc35..8146002 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java
@@ -145,21 +145,21 @@ public class DateFormatUtilsTest {
     }
 
     @Test
-    public void testDateISO(){
+    public void testDateISO() {
         testGmtMinus3("2002-02-23", DateFormatUtils.ISO_DATE_FORMAT.getPattern());
         testGmtMinus3("2002-02-23-03:00", DateFormatUtils.ISO_DATE_TIME_ZONE_FORMAT.getPattern());
         testUTC("2002-02-23Z", DateFormatUtils.ISO_DATE_TIME_ZONE_FORMAT.getPattern());
     }
 
     @Test
-    public void testTimeISO(){
+    public void testTimeISO() {
         testGmtMinus3("T09:11:12", DateFormatUtils.ISO_TIME_FORMAT.getPattern());
         testGmtMinus3("T09:11:12-03:00", DateFormatUtils.ISO_TIME_TIME_ZONE_FORMAT.getPattern());
         testUTC("T09:11:12Z", DateFormatUtils.ISO_TIME_TIME_ZONE_FORMAT.getPattern());
     }
 
     @Test
-    public void testTimeNoTISO(){
+    public void testTimeNoTISO() {
         testGmtMinus3("09:11:12", DateFormatUtils.ISO_TIME_NO_T_FORMAT.getPattern());
         testGmtMinus3("09:11:12-03:00", DateFormatUtils.ISO_TIME_NO_T_TIME_ZONE_FORMAT.getPattern());
         testUTC("09:11:12Z", DateFormatUtils.ISO_TIME_NO_T_TIME_ZONE_FORMAT.getPattern());


[4/4] [lang] Merge branch 'LANG-1126'

Posted by br...@apache.org.
Merge branch 'LANG-1126'


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/5c6a87c4
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/5c6a87c4
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/5c6a87c4

Branch: refs/heads/master
Commit: 5c6a87c46234ea135e0b235a6287843542c7b79e
Parents: 775203d 69fbbe1
Author: Benedikt Ritter <br...@apache.org>
Authored: Fri May 1 22:08:07 2015 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Fri May 1 22:08:07 2015 +0200

----------------------------------------------------------------------
 src/changes/changes.xml                         |  1 +
 .../commons/lang3/time/DateFormatUtilsTest.java | 34 ++++++++++++--------
 2 files changed, 21 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[3/4] [lang] Add LANG-1126 to changes.xml

Posted by br...@apache.org.
Add LANG-1126 to changes.xml


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/69fbbe17
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/69fbbe17
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/69fbbe17

Branch: refs/heads/master
Commit: 69fbbe1736c2e272dec768def717bacb8acfdfab
Parents: 260e0e0
Author: Benedikt Ritter <br...@apache.org>
Authored: Fri May 1 22:07:47 2015 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Fri May 1 22:07:47 2015 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/69fbbe17/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a7320df..9c7d922 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -22,6 +22,7 @@
   <body>
 
   <release version="3.5" date="tba" description="tba">
+    <action issue="LANG-1126" type="fix" dev="britter">DateFormatUtilsTest.testSMTP depends on the default Locale</action>
     <action issue="LANG-1123" type="fix" dev="chas" due-to="Christian P. Momon">Unit test FastDatePrinterTimeZonesTest needs a timezone set</action>
     <action issue="LANG-916" type="fix" dev="chas" due-to="Christian P. Momon">DateUtilsTest.testLang530 fails for some timezones</action>
     <action issue="LANG-1116" type="fix" dev="chas" due-to="Aaron Sheldon">DateUtilsTest.testLang530 fails for some timezones</action>