[OLINGO-887] Set timezone fix for testing

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

Branch: refs/heads/OLINGO-832_StreamSerializerPoC
Commit: d040afe78456b14632b9cefa46441830310f7d6c
Parents: a8d1d4c
Author: Christian Amend <[email protected]>
Authored: Wed Feb 17 14:48:02 2016 +0100
Committer: Christian Amend <[email protected]>
Committed: Wed Feb 17 14:48:02 2016 +0100

----------------------------------------------------------------------
 .../commons/core/edm/primitivetype/EdmDateTest.java | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d040afe7/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
----------------------------------------------------------------------
diff --git 
a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
 
b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
index e3f4c99..fad0aba 100644
--- 
a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
+++ 
b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,12 +26,24 @@ import java.util.TimeZone;
 
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 public class EdmDateTest extends PrimitiveTypeBaseTest {
 
   private final EdmPrimitiveType instance = 
EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Date);
 
+  @Before
+  public void setup() {
+    TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+  }
+
+  @After
+  public void teardown() {
+    TimeZone.setDefault(null);
+  }
+
   @Test
   public void toUriLiteral() throws Exception {
     assertEquals("2009-12-26", instance.toUriLiteral("2009-12-26"));

Reply via email to