Fix tests, rename tests to end in *Test, correct timezone issue in DateTime
test.

Patch by: jat
Review by: scottb, shanjian



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1556 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/test/com/google/gwt/dev/shell/TestCheckForUpdates.java b/dev/core/test/com/google/gwt/dev/shell/CheckForUpdatesTest.java
similarity index 97%
rename from dev/core/test/com/google/gwt/dev/shell/TestCheckForUpdates.java
rename to dev/core/test/com/google/gwt/dev/shell/CheckForUpdatesTest.java
index f623015..c3255c1 100644
--- a/dev/core/test/com/google/gwt/dev/shell/TestCheckForUpdates.java
+++ b/dev/core/test/com/google/gwt/dev/shell/CheckForUpdatesTest.java
@@ -2,7 +2,7 @@
 
 import junit.framework.TestCase;
 
-public class TestCheckForUpdates extends TestCase {
+public class CheckForUpdatesTest extends TestCase {
 
   /*
    * Test method for
diff --git a/dev/core/test/com/google/gwt/dev/util/TestUtility.java b/dev/core/test/com/google/gwt/dev/util/UtilityTest.java
similarity index 91%
rename from dev/core/test/com/google/gwt/dev/util/TestUtility.java
rename to dev/core/test/com/google/gwt/dev/util/UtilityTest.java
index be13a0d..4b47ca6 100644
--- a/dev/core/test/com/google/gwt/dev/util/TestUtility.java
+++ b/dev/core/test/com/google/gwt/dev/util/UtilityTest.java
@@ -5,7 +5,7 @@
 import java.net.URL;
 
 /** Pure junit test of Utility functionality*/
-public class TestUtility extends TestCase{
+public class UtilityTest extends TestCase{
   
   
   
diff --git a/user/test/com/google/gwt/dev/jjs/CompilerSuite.java b/user/test/com/google/gwt/dev/jjs/CompilerSuite.java
index 4dde3cb..23b1c2d 100644
--- a/user/test/com/google/gwt/dev/jjs/CompilerSuite.java
+++ b/user/test/com/google/gwt/dev/jjs/CompilerSuite.java
@@ -16,10 +16,11 @@
 package com.google.gwt.dev.jjs;
 
 import com.google.gwt.dev.jjs.test.AutoboxTest;
-import com.google.gwt.dev.jjs.test.ClassCastTestCase;
+import com.google.gwt.dev.jjs.test.BlankInterfaceTest;
+import com.google.gwt.dev.jjs.test.ClassCastTest;
 import com.google.gwt.dev.jjs.test.ClassObjectTest;
 import com.google.gwt.dev.jjs.test.CompilerTest;
-import com.google.gwt.dev.jjs.test.Coverage;
+import com.google.gwt.dev.jjs.test.CoverageTest;
 import com.google.gwt.dev.jjs.test.EnhancedForLoopTest;
 import com.google.gwt.dev.jjs.test.EnumsTest;
 import com.google.gwt.dev.jjs.test.HostedTest;
@@ -31,7 +32,6 @@
 import com.google.gwt.dev.jjs.test.MethodInterfaceTest;
 import com.google.gwt.dev.jjs.test.MiscellaneousTest;
 import com.google.gwt.dev.jjs.test.NativeLongTest;
-import com.google.gwt.dev.jjs.test.TestBlankInterface;
 import com.google.gwt.dev.jjs.test.VarargsTest;
 
 import junit.framework.Test;
@@ -47,10 +47,10 @@
 
     // $JUnit-BEGIN$
     suite.addTestSuite(AutoboxTest.class);
-    suite.addTestSuite(ClassCastTestCase.class);
+    suite.addTestSuite(ClassCastTest.class);
     suite.addTestSuite(ClassObjectTest.class);
     suite.addTestSuite(CompilerTest.class);
-    suite.addTestSuite(Coverage.class);
+    suite.addTestSuite(CoverageTest.class);
     suite.addTestSuite(EnhancedForLoopTest.class);
     suite.addTestSuite(EnumsTest.class);
     suite.addTestSuite(HostedTest.class);
@@ -62,7 +62,7 @@
     suite.addTestSuite(MethodInterfaceTest.class);
     suite.addTestSuite(MiscellaneousTest.class);
     suite.addTestSuite(NativeLongTest.class);
-    suite.addTestSuite(TestBlankInterface.class);
+    suite.addTestSuite(BlankInterfaceTest.class);
     suite.addTestSuite(VarargsTest.class);
     // $JUnit-END$
 
diff --git a/user/test/com/google/gwt/dev/jjs/test/TestBlankInterface.java b/user/test/com/google/gwt/dev/jjs/test/BlankInterfaceTest.java
similarity index 93%
rename from user/test/com/google/gwt/dev/jjs/test/TestBlankInterface.java
rename to user/test/com/google/gwt/dev/jjs/test/BlankInterfaceTest.java
index 7c85f3d..c3ad696 100644
--- a/user/test/com/google/gwt/dev/jjs/test/TestBlankInterface.java
+++ b/user/test/com/google/gwt/dev/jjs/test/BlankInterfaceTest.java
@@ -20,7 +20,7 @@
 /**
  * TODO: document me.
  */
-public class TestBlankInterface extends GWTTestCase implements
+public class BlankInterfaceTest extends GWTTestCase implements
     NoMethodsOrFields {
 
   public String getModuleName() {
diff --git a/user/test/com/google/gwt/dev/jjs/test/ClassCastTestCase.java b/user/test/com/google/gwt/dev/jjs/test/ClassCastTest.java
similarity index 97%
rename from user/test/com/google/gwt/dev/jjs/test/ClassCastTestCase.java
rename to user/test/com/google/gwt/dev/jjs/test/ClassCastTest.java
index 6c95694..7c1b778 100644
--- a/user/test/com/google/gwt/dev/jjs/test/ClassCastTestCase.java
+++ b/user/test/com/google/gwt/dev/jjs/test/ClassCastTest.java
@@ -20,7 +20,7 @@
 /**
  * TODO: document me.
  */
-public class ClassCastTestCase extends GWTTestCase {
+public class ClassCastTest extends GWTTestCase {
 
   static class Apple extends Food implements CanEatRaw {
   }
diff --git a/user/test/com/google/gwt/dev/jjs/test/Coverage.java b/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java
similarity index 90%
rename from user/test/com/google/gwt/dev/jjs/test/Coverage.java
rename to user/test/com/google/gwt/dev/jjs/test/CoverageTest.java
index 3302e38..fa1fd27 100644
--- a/user/test/com/google/gwt/dev/jjs/test/Coverage.java
+++ b/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java
@@ -22,7 +22,7 @@
  * possible in the Java to JavaScript compiler. This test is not at all intended
  * to execute correctly.
  */
-public class Coverage extends CoverageSuper {
+public class CoverageTest extends CoverageBase {
 
   /**
    * TODO: document me.
@@ -50,28 +50,28 @@
           x = z;
           this.x = z;
           Inner.this.x = z;
-          next = Coverage.this.next;
+          next = CoverageTest.this.next;
           next.foo();
-          Coverage.this.next.foo();
-          Coverage.this.x = z;
-          Coverage.super.x = z; // inexpressible in Java without name mangling
+          CoverageTest.this.next.foo();
+          CoverageTest.this.x = z;
+          CoverageTest.super.x = z; // inexpressible in Java without name mangling
         }
 
         public void foo() {
           x = z;
           this.x = z;
           Inner.this.x = z;
-          next = Coverage.this.next;
+          next = CoverageTest.this.next;
           next.foo();
-          Coverage.this.next.foo();
-          Coverage.this.x = z;
-          Coverage.super.x = z; // inexpressible in Java without name mangling
+          CoverageTest.this.next.foo();
+          CoverageTest.this.x = z;
+          CoverageTest.super.x = z; // inexpressible in Java without name mangling
         }
       };
 
       class NamedLocal extends Inner {
         public void foo() {
-          Coverage.this.getNext();
+          CoverageTest.this.getNext();
           Inner.this.bar();
           super.bar();
           int x = z;
@@ -257,7 +257,7 @@
     private void testClassLiteralAccess() {
       // ClassLiteralAccess
       o = Super.class;
-      assertEquals("class com.google.gwt.dev.jjs.test.Coverage$Super",
+      assertEquals("class com.google.gwt.dev.jjs.test.CoverageTest$Super",
           o.toString());
     }
 
@@ -358,8 +358,8 @@
 
     private void testInstanceOfExpression() {
       // InstanceOfExpression
-      Object o = Coverage.this;
-      assertTrue(o instanceof CoverageSuper);
+      Object o = CoverageTest.this;
+      assertTrue(o instanceof CoverageBase);
     }
 
     private void testLiterals() {
@@ -419,28 +419,28 @@
     private void testQualifiedAllocationExpression() {
       // QualifiedAllocationExpression
       o = new Inner();
-      o = Coverage.this.new Inner();
-      o = new Coverage().new Inner();
+      o = CoverageTest.this.new Inner();
+      o = new CoverageTest().new Inner();
     }
 
     private void testQualifiedNameReference() {
       // QualifiedNameReference
       // TODO: fields????
-      Coverage m = new Coverage();
+      CoverageTest m = new CoverageTest();
       ia = new int[2];
       assertEquals("1", 2, ia.length);
       assertEquals("2", 2, m.j);
       assertEquals("3", 4, m.y);
-      assertEquals("4", 2, new Coverage().j);
-      assertEquals("5", 4, new Coverage().y);
+      assertEquals("4", 2, new CoverageTest().j);
+      assertEquals("5", 4, new CoverageTest().y);
       assertEquals("6", 2, m.next.j);
       assertEquals("7", 4, m.next.y);
-      assertEquals("8", 2, new Coverage().next.j);
-      assertEquals("9", 4, new Coverage().next.y);
+      assertEquals("8", 2, new CoverageTest().next.j);
+      assertEquals("9", 4, new CoverageTest().next.y);
       assertEquals("A", 2, m.getNext().j);
       assertEquals("B", 4, m.getNext().y);
-      assertEquals("C", 2, new Coverage().getNext().j);
-      assertEquals("D", 4, new Coverage().getNext().y);
+      assertEquals("C", 2, new CoverageTest().getNext().j);
+      assertEquals("D", 4, new CoverageTest().getNext().y);
     }
 
     private void testReferenceCalls() {
@@ -450,21 +450,21 @@
       foo();
       this.foo();
       other.foo();
-      Coverage.this.foo();
+      CoverageTest.this.foo();
       super.foo();
       Inner.super.foo();
-      Coverage.super.foo();
+      CoverageTest.super.foo();
 
       sfoo();
       this.sfoo();
-      Coverage.sfoo();
+      CoverageTest.sfoo();
       Inner.sfoo();
       Super.sfoo();
       other.sfoo();
-      Coverage.this.sfoo();
+      CoverageTest.this.sfoo();
       super.sfoo();
       Inner.super.sfoo();
-      Coverage.super.sfoo();
+      CoverageTest.super.sfoo();
     }
 
     private Inner testReferences() {
@@ -476,7 +476,7 @@
       assertEquals(12, i);
       i = this.i + this.j + this.x + this.y;
       assertEquals(21, i);
-      i = Coverage.i + Coverage.j;
+      i = CoverageTest.i + CoverageTest.j;
       assertEquals(8, i);
       i = Inner.i + Inner.j;
       assertEquals(10, i);
@@ -486,14 +486,14 @@
       assertEquals(21, i);
       i = Inner.this.i + Inner.this.j + Inner.this.x + Inner.this.y;
       assertEquals(30, i);
-      i = Coverage.this.i + Coverage.this.j + Coverage.this.x + Coverage.this.y;
+      i = CoverageTest.this.i + CoverageTest.this.j + CoverageTest.this.x + CoverageTest.this.y;
       assertEquals(15, i);
       i = super.i + super.j + super.x + super.y;
       assertEquals(25, i);
       i = Inner.super.i + Inner.super.j + Inner.super.x + Inner.super.y;
       assertEquals(35, i);
-      i = Coverage.super.i + Coverage.super.j + Coverage.super.x
-          + Coverage.super.y;
+      i = CoverageTest.super.i + CoverageTest.super.j + CoverageTest.super.x
+          + CoverageTest.super.y;
       assertEquals(10, i);
       return other;
     }
@@ -630,14 +630,14 @@
     private int asdfasdfasdf = 3;
 
     InnerSub() {
-      new Coverage().super();
+      new CoverageTest().super();
     }
   }
 
   private static class SecondMain {
     private class FunkyInner extends Inner {
       FunkyInner() {
-        new Coverage().super();
+        new CoverageTest().super();
       }
     }
   }
@@ -662,7 +662,7 @@
 
   public static String s = "foo";
 
-  public static Coverage singleton;
+  public static CoverageTest singleton;
 
   public static boolean z;
 
@@ -683,13 +683,13 @@
 
   public final Inner inner = new Inner();
 
-  public Coverage next;
+  public CoverageTest next;
 
   public int x = 3;
 
   public final int y = 4;
 
-  public Coverage() {
+  public CoverageTest() {
     if (singleton == null) {
       singleton = this;
     }
@@ -703,7 +703,7 @@
     return "com.google.gwt.dev.jjs.CompilerSuite";
   }
 
-  public Coverage getNext() {
+  public CoverageTest getNext() {
     return next;
   }
 
@@ -849,7 +849,7 @@
 
 }
 
-abstract class CoverageSuper extends GWTTestCase {
+abstract class CoverageBase extends GWTTestCase {
 
   public static int i = 1;
   public static final int j = 2;
diff --git a/user/test/com/google/gwt/dev/jjs/test/HostedTest.java b/user/test/com/google/gwt/dev/jjs/test/HostedTest.java
index cf6684b..a9d0f24 100644
--- a/user/test/com/google/gwt/dev/jjs/test/HostedTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/HostedTest.java
@@ -53,7 +53,7 @@
     }
   }
 
-  private static class GenericListTest extends AbstractList<Object> {
+  private static class TestGenericList extends AbstractList<Object> {
     @Override
     public Object get(int index) {
       return this;
@@ -302,8 +302,8 @@
     assertTrue(obj instanceof String);
     assertEquals("foo", obj);
     obj = genericSubtype("test");
-    List<Object> list2 = genericSubtype(new GenericListTest());
-    assertTrue(list2 instanceof GenericListTest);
+    List<Object> list2 = genericSubtype(new TestGenericList());
+    assertTrue(list2 instanceof TestGenericList);
     assertEquals(42, list2.size());
     assertEquals(list2, list2.get(0));
     String[] array = new String[] { "foo", "bar" };
diff --git a/user/test/com/google/gwt/i18n/ConstantMapTest.java b/user/test/com/google/gwt/i18n/ConstantMapTest.java
index 0f2cac3..95a0b7f 100644
--- a/user/test/com/google/gwt/i18n/ConstantMapTest.java
+++ b/user/test/com/google/gwt/i18n/ConstantMapTest.java
@@ -22,7 +22,7 @@
 /**
  * TODO: document me.
  */
-public class ConstantMapTest extends TestMap {
+public class ConstantMapTest extends MapTestBase {
 
   protected Map makeEmptyMap() {
     return new ConstantMap();
diff --git a/user/test/com/google/gwt/i18n/TestMap.java b/user/test/com/google/gwt/i18n/MapTestBase.java
similarity index 97%
rename from user/test/com/google/gwt/i18n/TestMap.java
rename to user/test/com/google/gwt/i18n/MapTestBase.java
index 045961b..2901dd2 100644
--- a/user/test/com/google/gwt/i18n/TestMap.java
+++ b/user/test/com/google/gwt/i18n/MapTestBase.java
@@ -106,7 +106,7 @@
  * @author Paul Jack
  * @version $Id: TestMap.java,v 1.20.2.1 2004/05/22 12:14:05 scolebourne Exp $
  */
-public abstract class TestMap extends TestCase {
+public abstract class MapTestBase extends TestCase {
 
   // These instance variables are initialized with the reset method.
   // Tests for map methods that alter the map (put, putAll, remove)
@@ -712,20 +712,20 @@
     }
 
     protected void resetFull() {
-      TestMap.this.resetFull();
+      MapTestBase.this.resetFull();
       collection = map.entrySet();
-      TestMapEntrySet.this.confirmed = TestMap.this.confirmed.entrySet();
+      TestMapEntrySet.this.confirmed = MapTestBase.this.confirmed.entrySet();
     }
 
     protected void resetEmpty() {
-      TestMap.this.resetEmpty();
+      MapTestBase.this.resetEmpty();
       collection = map.entrySet();
-      TestMapEntrySet.this.confirmed = TestMap.this.confirmed.entrySet();
+      TestMapEntrySet.this.confirmed = MapTestBase.this.confirmed.entrySet();
     }
 
     protected void verify() {
       super.verify();
-      TestMap.this.verify();
+      MapTestBase.this.verify();
     }
   }
 
@@ -759,20 +759,20 @@
     }
 
     protected void resetEmpty() {
-      TestMap.this.resetEmpty();
+      MapTestBase.this.resetEmpty();
       collection = map.keySet();
-      TestMapKeySet.this.confirmed = TestMap.this.confirmed.keySet();
+      TestMapKeySet.this.confirmed = MapTestBase.this.confirmed.keySet();
     }
 
     protected void resetFull() {
-      TestMap.this.resetFull();
+      MapTestBase.this.resetFull();
       collection = map.keySet();
-      TestMapKeySet.this.confirmed = TestMap.this.confirmed.keySet();
+      TestMapKeySet.this.confirmed = MapTestBase.this.confirmed.keySet();
     }
 
     protected void verify() {
       super.verify();
-      TestMap.this.verify();
+      MapTestBase.this.verify();
     }
   }
 
@@ -822,20 +822,20 @@
     }
 
     protected void resetFull() {
-      TestMap.this.resetFull();
+      MapTestBase.this.resetFull();
       collection = map.values();
-      TestMapValues.this.confirmed = TestMap.this.confirmed.values();
+      TestMapValues.this.confirmed = MapTestBase.this.confirmed.values();
     }
 
     protected void resetEmpty() {
-      TestMap.this.resetEmpty();
+      MapTestBase.this.resetEmpty();
       collection = map.values();
-      TestMapValues.this.confirmed = TestMap.this.confirmed.values();
+      TestMapValues.this.confirmed = MapTestBase.this.confirmed.values();
     }
 
     protected void verify() {
       super.verify();
-      TestMap.this.verify();
+      MapTestBase.this.verify();
     }
 
     // TODO: should test that a remove on the values collection view
diff --git a/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java b/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java
index f0abd02..b4e421a 100644
--- a/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java
+++ b/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java
@@ -30,41 +30,41 @@
   }
 
   public void test_EEEEMMMddyy() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("Donnerstag,Juli 27, 2006", format("EEEE,MMMM dd, yyyy", date));
   }
 
   public void test_EEEMMMddyy() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("Do, Jul 27, 06", format("EEE, MMM d, yy", date));
   }
 
   public void test_HHmmss() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("13:10:10", format("HH:mm:ss", date));
   }
 
   public void test_hhmmssa() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("1:10:10 nachm.", format("h:mm:ss a", date));
   }
 
   public void test_MMddyyyyHHmmssZ() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     String tz = getTimezoneString(date, false);
     String actual = format("MM/dd/yyyy HH:mm:ss Z", date);
     assertEquals("07/27/2006 13:10:10 " + tz, actual);
   }
 
   public void test_MMddyyyyHHmmsszzz() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     String tz = getTimezoneString(date);
     String actual = format("MM/dd/yyyy HH:mm:ss zzz", date);
     assertEquals("07/27/2006 13:10:10 GMT" + tz, actual);
   }
 
   public void test_predefinedFormat() {
-    Date date = getUTCDate(2006 - 1900, 7, 4, 13, 49, 24);
+    Date date = getDateFromUTC(2006 - 1900, 7, 4, 13, 49, 24);
     String tz = getTimezoneString(date);
 
     String fullDateFormat = DateTimeFormat.getFullDateFormat().format(date);
@@ -107,40 +107,40 @@
   public void test_QQQQyy() {
     Date date;
 
-    date = getUTCDate(2006 - 1900, 0, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 0, 27, 13, 10, 10);
     assertEquals("1. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 1, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 1, 27, 13, 10, 10);
     assertEquals("1. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 2, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 2, 27, 13, 10, 10);
     assertEquals("1. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 3, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 3, 27, 13, 10, 10);
     assertEquals("2. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 4, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 4, 27, 13, 10, 10);
     assertEquals("2. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 5, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 5, 27, 13, 10, 10);
     assertEquals("2. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("3. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 7, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 7, 27, 13, 10, 10);
     assertEquals("3. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 8, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 8, 27, 13, 10, 10);
     assertEquals("3. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 9, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 9, 27, 13, 10, 10);
     assertEquals("4. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 10, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 10, 27, 13, 10, 10);
     assertEquals("4. Quartal 06", format("QQQQ yy", date));
 
-    date = getUTCDate(2006 - 1900, 11, 27, 13, 10, 10);
+    date = getDateFromUTC(2006 - 1900, 11, 27, 13, 10, 10);
     assertEquals("4. Quartal 06", format("QQQQ yy", date));
   }
 
@@ -218,7 +218,7 @@
   }
 
   public void test_yyyyMMddG() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     String tz = getTimezoneString(date);
 
     String expected = "2006.07.27 n. Chr. at 13:10:10 GMT" + tz;
@@ -227,7 +227,7 @@
   }
 
   public void test_yyyyyMMMMM() {
-    Date date = getUTCDate(2006 - 1900, 6, 27, 13, 10, 10);
+    Date date = getDateFromUTC(2006 - 1900, 6, 27, 13, 10, 10);
     assertEquals("2006.J.27 n. Chr. 01:10 nachm.", format(
         "yyyyy.MMMMM.dd GGG hh:mm aaa", date));
   }
@@ -253,12 +253,12 @@
     return tzOffsetStr;
   }
 
-  private Date getUTCDate(int year, int month, int day, int hrs, int mins,
+  private Date getDateFromUTC(int year, int month, int day, int hrs, int mins,
       int secs) {
-    long localTzOffset = new Date().getTimezoneOffset();
+    long localTzOffset = new Date(year, month, day, hrs, mins, secs).getTimezoneOffset();
     long utc = Date.UTC(year, month, day, hrs, mins, secs);
     long localTzOffsetMillis = localTzOffset * 60 * 1000;
-    utc += localTzOffsetMillis;
-    return new Date(utc);
+    long localTime = utc + localTzOffsetMillis;
+    return new Date(localTime);
   }
 }