chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r1197167 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src: main/java/org/apache/chemistry/opencmis/server/support/query/ test/java/org/apache/chemistry/opencmis/server/support/query/
Date Thu, 03 Nov 2011 14:52:23 GMT
Author: fguillaume
Date: Thu Nov  3 14:52:23 2011
New Revision: 1197167

URL: http://svn.apache.org/viewvc?rev=1197167&view=rev
Log:
CMIS-466: timezone is optional

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/CalendarHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/test/java/org/apache/chemistry/opencmis/server/support/query/TestCalendarHelper.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/CalendarHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/CalendarHelper.java?rev=1197167&r1=1197166&r2=1197167&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/CalendarHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/CalendarHelper.java
Thu Nov  3 14:52:23 2011
@@ -35,7 +35,7 @@ public class CalendarHelper {
 
     private static final Pattern CMISQL_PATTERN = Pattern.compile( //
             "(\\d{4})-(\\d{2})-(\\d{2})[Tt]" + "(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?"
-                    + "(?:[Zz]|([+-]\\d{2}:\\d{2}))");
+                    + "(?:[Zz]|([+-]\\d{2}:\\d{2}))?");
 
     private CalendarHelper() {
         // utility class

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/test/java/org/apache/chemistry/opencmis/server/support/query/TestCalendarHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/test/java/org/apache/chemistry/opencmis/server/support/query/TestCalendarHelper.java?rev=1197167&r1=1197166&r2=1197167&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/test/java/org/apache/chemistry/opencmis/server/support/query/TestCalendarHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/test/java/org/apache/chemistry/opencmis/server/support/query/TestCalendarHelper.java
Thu Nov  3 14:52:23 2011
@@ -83,6 +83,15 @@ public class TestCalendarHelper {
         assertEquals("2009-07-14T12:00:00.440Z", CalendarHelper.toString(cal));
         cal = CalendarHelper.fromString("2009-07-14T12:00:00.333Z");
         assertEquals("2009-07-14T12:00:00.333Z", CalendarHelper.toString(cal));
+        // no timezone
+        cal = CalendarHelper.fromString("2009-07-14T12:00:00");
+        assertEquals("2009-07-14T12:00:00.000Z", CalendarHelper.toString(cal));
+        cal = CalendarHelper.fromString("2009-07-14T12:00:00.5");
+        assertEquals("2009-07-14T12:00:00.500Z", CalendarHelper.toString(cal));
+        cal = CalendarHelper.fromString("2009-07-14T12:00:00.44");
+        assertEquals("2009-07-14T12:00:00.440Z", CalendarHelper.toString(cal));
+        cal = CalendarHelper.fromString("2009-07-14T12:00:00.333");
+        assertEquals("2009-07-14T12:00:00.333Z", CalendarHelper.toString(cal));
     }
 
 }



Mime
View raw message