myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r781503 - in /myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src: main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ test/java/org/apache/myfaces/trinidadinternal/renderkit/ test/resources/org/apache/myfaces/trinida...
Date Wed, 03 Jun 2009 18:46:25 GMT
Author: jwaldman
Date: Wed Jun  3 18:46:25 2009
New Revision: 781503

URL: http://svn.apache.org/viewvc?rev=781503&view=rev
Log:
TRINIDAD-1419 Trinidad chooseDate golden files break with daylight savings
apply to trinidad-1.0.x

Modified:
    myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
    myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MVariableResolver.java
    myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/chooseDate.xml

Modified: myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java?rev=781503&r1=781502&r2=781503&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
(original)
+++ myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ChooseDateRenderer.java
Wed Jun  3 18:46:25 2009
@@ -75,6 +75,7 @@
     _maxValueKey = type.findKey("maxValue");
     _minValueKey = type.findKey("minValue");
     _valueKey = PropertyKey.createPropertyKey("value");
+    _currTimeKey = PropertyKey.createPropertyKey("currTime");
     _scrolledValueKey = PropertyKey.createPropertyKey("scrolledValue");
     _destinationKey = PropertyKey.createPropertyKey("destination");
   }
@@ -122,7 +123,17 @@
     // the application timezone, the offset value may be different. In that case
     // pass the new offset value for the client to use. 
     TimeZone tz = arc.getLocaleContext().getTimeZone();
-    int baseTZOffsetMinutes = tz.getOffset(System.currentTimeMillis())/(1000*60);
+    
+    // TRINIDAD-1419: chooseDate golden files should stay the same even if
+    // the server runs in different timezones. 
+    long currTimeMillis = 0;
+    Object currTimeValue =  bean.getProperty (_currTimeKey);
+    if (currTimeValue != null)
+      currTimeMillis = ((Date) currTimeValue).getTime();
+    else
+      currTimeMillis = System.currentTimeMillis();
+    
+    int baseTZOffsetMinutes = tz.getOffset(currTimeMillis/(1000*60));
 
     boolean isDesktop = isDesktop(arc);
     ResponseWriter writer = context.getResponseWriter();
@@ -1588,6 +1599,7 @@
   private PropertyKey _maxValueKey;
   private PropertyKey _minValueKey;
   private PropertyKey _valueKey;
+  private PropertyKey _currTimeKey;
   private PropertyKey _scrolledValueKey;
   private PropertyKey _destinationKey;
 

Modified: myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MVariableResolver.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MVariableResolver.java?rev=781503&r1=781502&r2=781503&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MVariableResolver.java
(original)
+++ myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MVariableResolver.java
Wed Jun  3 18:46:25 2009
@@ -234,6 +234,10 @@
       // FIXME: Should be able to use Calendar for non deprecated calls.
       return new Date(130, 0, 5);
     }
+    else if ("currTime".equals(name))
+    {
+      return new Date(109,0,1);
+    }
     else if("simpleDocument".equals(name))
     {
       return "First paragraph followed by \\r\r" + 

Modified: myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/chooseDate.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/chooseDate.xml?rev=781503&r1=781502&r2=781503&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/chooseDate.xml
(original)
+++ myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/testScripts/chooseDate.xml
Wed Jun  3 18:46:25 2009
@@ -3,6 +3,7 @@
        agentNotSupported="pda">
  <base-component tr:type="org.apache.myfaces.trinidad.CoreChooseDate"
      value="#{midDate}" minValue="#{oldDate}" maxValue="#{newDate}"
+     currTime="#{currTime}" 
      scrolledValue="#{null}"/>
   <attribute-test name="id" value="dateid"/>
   <attribute-test name="inlineStyle"/>



Mime
View raw message