From 058f7344db3187014e20de5d560c30e795839df6 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Fri, 8 Jan 2010 18:53:39 +0000 Subject: [PATCH] Revised the setup for date/time tests to use PST time-zone. This fixes bug 184 by ensuring that tests are run in PST time-zone. --- .../gson/functional/DefaultTypeAdaptersTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java index 71440439..caf4b4fd 100644 --- a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java @@ -36,6 +36,7 @@ import java.util.HashSet; import java.util.Locale; import java.util.Properties; import java.util.Set; +import java.util.TimeZone; import java.util.UUID; /** @@ -47,13 +48,22 @@ import java.util.UUID; */ public class DefaultTypeAdaptersTest extends TestCase { private Gson gson; + private TimeZone oldTimeZone; @Override protected void setUp() throws Exception { super.setUp(); + this.oldTimeZone = TimeZone.getDefault(); + TimeZone.setDefault(TimeZone.getTimeZone("PST")); gson = new Gson(); } + @Override + protected void tearDown() throws Exception { + TimeZone.setDefault(oldTimeZone); + super.tearDown(); + } + public void testUrlSerialization() throws Exception { String urlValue = "http://google.com/"; URL url = new URL(urlValue);