Repository: olingo-odata4
Updated Branches:
  refs/heads/master 95e2d8d33 -> eb2e3b78a


[OLINGO-317] Fix problem with Timezone in test


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/eb2e3b78
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/eb2e3b78
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/eb2e3b78

Branch: refs/heads/master
Commit: eb2e3b78aa339bb83924acc2d33b3092e88958d3
Parents: 95e2d8d
Author: Michael Bolz <[email protected]>
Authored: Mon Jul 7 08:43:59 2014 +0200
Committer: Michael Bolz <[email protected]>
Committed: Mon Jul 7 08:43:59 2014 +0200

----------------------------------------------------------------------
 .../json/ODataJsonSerializerTest.java           | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/eb2e3b78/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
----------------------------------------------------------------------
diff --git 
a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
 
b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
index 91e49b9..61b6954 100644
--- 
a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
+++ 
b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
@@ -337,8 +337,8 @@ public class ODataJsonSerializerTest {
         "\"PropertyDecimal\":4711.1174," +
         "\"PropertyBinary\":\"BAcBAQ==\"," +
         "\"PropertyDate\":\"2014-03-19\"," +
-        "\"PropertyDateTimeOffset\":\"2014-03-19T10:12:00+01:00\"," +
-        "\"PropertyDuration\":\"P16148383DT8H0S\"," +
+        "\"PropertyDateTimeOffset\":\"2014-03-19T11:12:00+01:00\"," +
+        "\"PropertyDuration\":\"P16148425DT0S\"," +
         "\"PropertyGuid\":\"0000aaaa-00bb-00cc-00dd-000000ffffff\"," +
         "\"PropertyTimeOfDay\":\"10:12:00\"" +
         "}";
@@ -396,8 +396,8 @@ public class ODataJsonSerializerTest {
         "\"CollPropertyDecimal\":[4711.1174,1174.4711]," +
         "\"CollPropertyBinary\":[\"BAcBAQ==\",\"dGVzdA==\"]," +
         "\"CollPropertyDate\":[\"2014-03-19\",\"2014-07-02\"]," +
-        
"\"CollPropertyDateTimeOffset\":[\"2014-03-19T10:12:00+01:00\",\"2014-07-02T13:30:00+02:00\"],"
 +
-        "\"CollPropertyDuration\":[\"P16148383DT8H0S\",\"P16253479DT4H0S\"]," +
+        
"\"CollPropertyDateTimeOffset\":[\"2014-03-19T11:12:00+01:00\",\"2014-07-02T15:30:00+02:00\"],"
 +
+        "\"CollPropertyDuration\":[\"P16148425DT0S\",\"P16253562DT12H0S\"]," +
         
"\"CollPropertyGuid\":[\"0000aaaa-00bb-00cc-00dd-000000ffffff\",\"0000ffff-00dd-00cc-00bb-000000aaaaaa\"],"
 +
         "\"CollPropertyTimeOfDay\":[\"10:12:00\",\"13:30:00\"]" +
         "}";
@@ -433,8 +433,8 @@ public class ODataJsonSerializerTest {
         "\"PropertyDecimal\":4711.1174," +
         "\"PropertyBinary\":\"BAcBAQ==\"," +
         "\"PropertyDate\":\"2014-03-19\"," +
-        "\"PropertyDateTimeOffset\":\"2014-03-19T10:12:00+01:00\"," +
-        "\"PropertyDuration\":\"P16148383DT8H0S\"," +
+        "\"PropertyDateTimeOffset\":\"2014-03-19T11:12:00+01:00\"," +
+        "\"PropertyDuration\":\"P16148425DT0S\"," +
         "\"PropertyGuid\":\"0000aaaa-00bb-00cc-00dd-000000ffffff\"," +
         "\"PropertyTimeOfDay\":\"10:12:00\"" +
         "}}";
@@ -455,10 +455,10 @@ public class ODataJsonSerializerTest {
 
   private Entity createETCollAllPrim(int id) {
     Entity entity = new EntityImpl();
-    Calendar date = Calendar.getInstance();
+    Calendar date = createCalendarInstance();
     date.set(2014, Calendar.MARCH, 19, 10, 12, 0);
     date.set(Calendar.MILLISECOND, 0);
-    Calendar date2 = Calendar.getInstance();
+    Calendar date2 = createCalendarInstance();
     date2.set(2014, Calendar.JULY, 2, 13, 30, 0);
     date2.set(Calendar.MILLISECOND, 0);
     //
@@ -503,7 +503,7 @@ public class ODataJsonSerializerTest {
 
   private Entity createETAllPrim(int id) {
     Entity entity = new EntityImpl();
-    Calendar date = Calendar.getInstance();
+    Calendar date = createCalendarInstance();
     date.set(2014, Calendar.MARCH, 19, 10, 12, 0);
     date.set(Calendar.MILLISECOND, 0);
     entity.addProperty(createProperty("Edm.Int16", TecSvcSimpleProperty.Int16, 
ValueType.PRIMITIVE, id));
@@ -531,6 +531,10 @@ public class ODataJsonSerializerTest {
     return entity;
   }
 
+  private Calendar createCalendarInstance() {
+    return Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
+  }
+
   private String streamToString(InputStream result) throws IOException {
     byte[] buffer = new byte[8192];
     StringBuilder sb = new StringBuilder();

Reply via email to