changeset 7679:54d3f711ae54

[TEST ONLY] Fix tests for RT-38012. The explicit TimeZone was not uniformly applied to all objects.
author leifs
date Thu, 14 Aug 2014 10:40:43 -0700
parents f7cf21c9e487
children 9ba20c17e0f9
files modules/base/src/test/java/javafx/util/converter/DateStringConverterTest.java modules/base/src/test/java/javafx/util/converter/DateTimeStringConverterTest.java modules/base/src/test/java/javafx/util/converter/TimeStringConverterTest.java
diffstat 3 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/modules/base/src/test/java/javafx/util/converter/DateStringConverterTest.java	Thu Aug 14 10:48:40 2014 -0600
+++ b/modules/base/src/test/java/javafx/util/converter/DateStringConverterTest.java	Thu Aug 14 10:40:43 2014 -0700
@@ -48,8 +48,8 @@
     private static final Date VALID_DATE;
 
     static {
+        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
         Calendar c = Calendar.getInstance();
-        c.setTimeZone(TimeZone.getTimeZone("GMT"));
         c.set(Calendar.YEAR, 1985);
         c.set(Calendar.MONTH, Calendar.JANUARY);
         c.set(Calendar.DAY_OF_MONTH, 12);
@@ -114,7 +114,6 @@
     }
     
     @Before public void setup() {
-        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
     }
     
     /*********************************************************************
@@ -146,13 +145,11 @@
      * Test toString / fromString methods
      ********************************************************************/    
     
-    @Ignore
     @Test public void fromString_testValidInput() {
         String input = validFormatter.format(validDate);
         assertEquals("Input = "+input, validDate, converter.fromString(input));
     }
     
-    @Ignore
     @Test public void fromString_testValidInputWithWhiteSpace() {
         String input = validFormatter.format(validDate);
         assertEquals("Input = "+input, validDate, converter.fromString("      " + input + "      "));
@@ -163,7 +160,6 @@
         converter.fromString("abcdefg");
     }
     
-    @Ignore
     @Test public void toString_validOutput() {
         assertEquals(validFormatter.format(validDate), converter.toString(validDate));
     }    
--- a/modules/base/src/test/java/javafx/util/converter/DateTimeStringConverterTest.java	Thu Aug 14 10:48:40 2014 -0600
+++ b/modules/base/src/test/java/javafx/util/converter/DateTimeStringConverterTest.java	Thu Aug 14 10:40:43 2014 -0700
@@ -49,8 +49,8 @@
     private static final Date VALID_DATE_WITHOUT_SECONDS;
 
     static {
+        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
         Calendar c = Calendar.getInstance();
-        c.setTimeZone(TimeZone.getTimeZone("GMT"));
         c.set(Calendar.YEAR, 1985);
         c.set(Calendar.MONTH, Calendar.JANUARY);
         c.set(Calendar.DAY_OF_MONTH, 12);
@@ -119,7 +119,6 @@
     }
     
     @Before public void setup() {
-        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
     }
     
     /*********************************************************************
@@ -151,13 +150,11 @@
      * Test toString / fromString methods
      ********************************************************************/    
    
-    @Ignore
     @Test public void fromString_testValidInput() {
         String input = validFormatter.format(validDate);
         assertEquals("Input = "+input, validDate, converter.fromString(input));
     }
     
-    @Ignore
     @Test public void fromString_testValidInputWithWhiteSpace() {
         String input = validFormatter.format(validDate);
         assertEquals("Input = "+input, validDate, converter.fromString("      " + input + "      "));
@@ -168,7 +165,6 @@
         converter.fromString("abcdefg");
     }
     
-    @Ignore
     @Test public void toString_validOutput() {
         assertEquals(validFormatter.format(validDate), converter.toString(validDate));
     }    
--- a/modules/base/src/test/java/javafx/util/converter/TimeStringConverterTest.java	Thu Aug 14 10:48:40 2014 -0600
+++ b/modules/base/src/test/java/javafx/util/converter/TimeStringConverterTest.java	Thu Aug 14 10:40:43 2014 -0700
@@ -48,8 +48,8 @@
     private static final Date VALID_TIME_WITHOUT_SECONDS;
     
     static {
+        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
         Calendar c = Calendar.getInstance();
-        c.setTimeZone(TimeZone.getTimeZone("GMT"));
         c.clear();
         c.set(Calendar.HOUR_OF_DAY, 12);
         c.set(Calendar.MINUTE, 34);
@@ -113,7 +113,6 @@
     }
     
     @Before public void setup() {
-        TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
     }
     
     /*********************************************************************