groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: Change the tests testGDKDateMethods and testStaticParseToStringDate so that they run with java 6/7/8/9.
Date Tue, 21 Jul 2015 18:28:17 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X df462e9f0 -> e52038236


Change the tests testGDKDateMethods and testStaticParseToStringDate so that they run with
java 6/7/8/9.

Due to changes in JDK 9 caused the fix for "JDK-8008577 : Use CLDR Locale Data by Default"
(http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8008577) they failed when run with java
9.


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/e5203823
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/e5203823
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/e5203823

Branch: refs/heads/GROOVY_2_4_X
Commit: e52038236752b926d0cf8cdc3736369b1e7b8f00
Parents: df462e9
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Tue Jul 21 20:26:53 2015 +0200
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Tue Jul 21 20:27:59 2015 +0200

----------------------------------------------------------------------
 .../org/codehaus/groovy/runtime/DateGDKTest.groovy | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/e5203823/src/test/org/codehaus/groovy/runtime/DateGDKTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/DateGDKTest.groovy b/src/test/org/codehaus/groovy/runtime/DateGDKTest.groovy
index c4a1e39..2c27878 100644
--- a/src/test/org/codehaus/groovy/runtime/DateGDKTest.groovy
+++ b/src/test/org/codehaus/groovy/runtime/DateGDKTest.groovy
@@ -30,20 +30,19 @@ class DateGDKTest extends GroovyTestCase {
         Locale defaultLocale = Locale.default
         TimeZone defaultTZ = TimeZone.default
         try {
-            Locale locale = Locale.UK
+            Locale locale = Locale.GERMANY
             Locale.setDefault locale // set this otherwise the test will fail if your locale
isn't the same
-            TimeZone.setDefault TimeZone.getTimeZone('Etc/GMT')
+            TimeZone.setDefault TimeZone.getTimeZone('Europe/Berlin')
             
             Date d = new Date(0)
             
             assertEquals '1970-01-01', d.format('yyyy-MM-dd')
-            assertEquals '01/Jan/1970', d.format('dd/MMM/yyyy', TimeZone.getTimeZone('GMT'))
+            assertEquals '01/01/1970', d.format('dd/MM/yyyy', TimeZone.getTimeZone('GMT'))
             assertEquals DateFormat.getDateInstance(DateFormat.SHORT, locale).format(d),
d.dateString
-            assertEquals '01/01/70', d.dateString
+            assertEquals '01.01.70', d.dateString
             assertEquals DateFormat.getTimeInstance(DateFormat.MEDIUM, locale).format(d),
d.timeString
-            assertEquals '00:00:00', d.timeString
+            assertEquals '01:00:00', d.timeString
             assertEquals DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM,
locale).format(d), d.dateTimeString
-            assertEquals '01/01/70 00:00:00', d.dateTimeString
         } finally {
             Locale.default = defaultLocale
             TimeZone.setDefault defaultTZ
@@ -160,10 +159,12 @@ class DateGDKTest extends GroovyTestCase {
     void testStaticParseToStringDate() {
         TimeZone tz = TimeZone.getDefault()
         try {
-            TimeZone.setDefault(TimeZone.getTimeZone("CET"))
+            TimeZone.setDefault(TimeZone.getTimeZone("GMT"))
+
             Date date = new Date(0)
             String toStringRepresentation = date.toString()
-            assert toStringRepresentation == "Thu Jan 01 01:00:00 CET 1970"
+
+            assert toStringRepresentation == "Thu Jan 01 00:00:00 GMT 1970"
             assert date == Date.parseToStringDate(toStringRepresentation)
         }
         finally {


Mime
View raw message