axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject cvs commit: xml-axis/java/test/wsdl/extensibility ExtensibilityQueryTestCase.java
Date Mon, 20 May 2002 07:56:30 GMT
glyn        02/05/20 00:56:30

  Modified:    java/src/org/apache/axis/encoding/ser
                        CalendarSerializer.java
               java/test/wsdl/extensibility ExtensibilityQueryTestCase.java
  Log:
  Fix bug in CalendarSerializer. Dates were being serialized using the local
  timezone and deserialized as if they were GMT. This caused problems when
  daylight savings time was in use locally. These dates are now serialized to
  GMT.
  
  Also commmit the extra diagnostics added to the testcase for future reference.
  
  Revision  Changes    Path
  1.2       +2 -4      xml-axis/java/src/org/apache/axis/encoding/ser/CalendarSerializer.java
  
  Index: CalendarSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/CalendarSerializer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CalendarSerializer.java	31 Mar 2002 23:09:33 -0000	1.1
  +++ CalendarSerializer.java	20 May 2002 07:56:30 -0000	1.2
  @@ -97,11 +97,9 @@
           context.startElement(name, attributes);
   
           Calendar calendar = (Calendar) value;
  -        SimpleDateFormat format = 
  -          new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
  -        format.setTimeZone(calendar.getTimeZone());
           Date date = calendar.getTime();
  -        context.writeString(format.format(date));
  +        // Serialize including convert to GMT
  +        context.writeString(zulu.format(date));
   
           context.endElement();
       }
  
  
  
  1.4       +7 -1      xml-axis/java/test/wsdl/extensibility/ExtensibilityQueryTestCase.java
  
  Index: ExtensibilityQueryTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/extensibility/ExtensibilityQueryTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExtensibilityQueryTestCase.java	10 May 2002 15:24:31 -0000	1.3
  +++ ExtensibilityQueryTestCase.java	20 May 2002 07:56:30 -0000	1.4
  @@ -67,7 +67,13 @@
                                  
           assertTrue(result.getName().equals(name));
           assertTrue(result.getValue().equals(value));
  -        assertTrue(result.getTime().before(Calendar.getInstance()));
  +        Calendar now = Calendar.getInstance();
  +        Calendar then = result.getTime();
  +        if (!then.before(now)) {
  +            System.out.println("Time check failed. Result time = " + then + ", current
time = "
  +                               + now);
  +        }
  +        assertTrue(then.before(now));
           assertTrue(result.getQueryType().getNamespaceURI().equals("urn:QueryType"));
           assertTrue(result.getQueryType().getLocalPart().equals("BookQuery"));
       }
  
  
  

Mime
View raw message