tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlewissh...@apache.org
Subject cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/junit TestBindings.java
Date Mon, 08 Dec 2003 00:08:28 GMT
rlewisshell    2003/12/07 16:08:28

  Modified:    junit/src/org/apache/tapestry/junit TestBindings.java
  Log:
  fixing testTypeConverter() for JDK 1.3 (where java.sql.Timestamp/java.util.Date equals()
are problematic)
  
  Revision  Changes    Path
  1.7       +7 -2      jakarta-tapestry/junit/src/org/apache/tapestry/junit/TestBindings.java
  
  Index: TestBindings.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/TestBindings.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestBindings.java	25 Nov 2003 14:08:16 -0000	1.6
  +++ TestBindings.java	8 Dec 2003 00:08:28 -0000	1.7
  @@ -794,6 +794,11 @@
           engine.setSpecification(appSpec);
   
           binding.setObject(date);
  -        assertEquals(date, page.getDateValue());
  +        // note - cannot treat java.sql.Timestamp as a Date as the nanos store the
  +        // fractional part of the second, including the millis.  JDK 1.3 Javadocs
  +        // for Timestamp suggest using nanos/1000000 to find the actual millis.
  +        // Otherwise, just using assertEquals(date, page.getDateValue()) fails 
  +        // under JDK 1.3.
  +        assertEquals(date, new Date(page.getDateValue().getTime() + page.getDateValue().getNanos()
/ 1000000));
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message