KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > testutil > TimeZoneChanger


1 package com.thoughtworks.xstream.testutil;
2
3 import junit.extensions.TestDecorator;
4 import junit.framework.Test;
5 import junit.framework.TestResult;
6
7 import java.util.TimeZone JavaDoc;
8
9 public class TimeZoneChanger {
10
11     private static final TimeZone JavaDoc originalTimeZone = TimeZone.getDefault();
12
13     public static void change(String JavaDoc timeZone) {
14         TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
15     }
16
17     public static void reset() {
18         TimeZone.setDefault(originalTimeZone);
19     }
20
21 }
22
Popular Tags