chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1479594 - in /chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src: main/java/org/apache/chemistry/opencmis/commons/impl/ test/java/org/apache/chemistry/opencmis/commons/impl/misc/
Date Mon, 06 May 2013 14:56:08 GMT
Author: fmui
Date: Mon May  6 14:56:08 2013
New Revision: 1479594

URL: http://svn.apache.org/r1479594
Log:
CMIS-654: fixed AtomPub DateTime values

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/DateTimeTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java?rev=1479594&r1=1479593&r2=1479594&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/DateTimeHelper.java
Mon May  6 14:56:08 2013
@@ -143,7 +143,7 @@ public class DateTimeHelper {
             }
         }
 
-        int tz = cal.getTimeZone().getRawOffset();
+        int tz = cal.getTimeZone().getOffset(cal.getTimeInMillis());
         if (tz == 0) {
             sb.append("Z");
         } else {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/DateTimeTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/DateTimeTest.java?rev=1479594&r1=1479593&r2=1479594&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/DateTimeTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/DateTimeTest.java
Mon May  6 14:56:08 2013
@@ -95,6 +95,18 @@ public class DateTimeTest {
         cal5.set(Calendar.MILLISECOND, 0);
 
         assertEquals("2012-12-24T08:10:11Z", DateTimeHelper.formatXmlDateTime(cal5.getTimeInMillis()));
+
+        GregorianCalendar cal6 = new GregorianCalendar(TimeZone.getTimeZone("Europe/Berlin"));
+        cal6.set(2013, 4, 6, 9, 10, 11);
+        cal6.set(Calendar.MILLISECOND, 0);
+
+        assertEquals("2013-05-06T09:10:11+02:00", DateTimeHelper.formatXmlDateTime(cal6));
+        
+        GregorianCalendar cal7 = new GregorianCalendar(TimeZone.getTimeZone("Europe/Berlin"));
+        cal7.set(2012, 11, 24, 9, 10, 11);
+        cal7.set(Calendar.MILLISECOND, 0);
+
+        assertEquals("2012-12-24T09:10:11+01:00", DateTimeHelper.formatXmlDateTime(cal7));
     }
 
     @Test



Mime
View raw message