Thanks Fuhwei

I've raised a JIRA against the CTS to move the duration tests to the
UnderReview suite until this issue is properly resolved in the
specification.

Andy. 

-----Original Message-----
From: Fuhwei Lwo [mailto:[EMAIL PROTECTED] 
Sent: 15 March 2007 02:26
To: tuscany-dev@ws.apache.org
Subject: Re: SDO CTS tests for DataHelper date formats

I did search on SDO spec discussion threads and found out the following
2 links. Based on the first link, it seems Tuscany SDO implementation on
DataHelper.toDate(String) for duration string is broken. It seems the
algorithm (with my understanding) should be
1) create a calendar with current time
2) take the information from the duration string then add/substract
to/from the current time calendar
3) invoke Calendar.getTime() to return a Date object

http://www.xcalia.com/support/browse/SDO-95 (Fixed in SDO 2.1)
http://www.xcalia.com/support/browse/SDO-189 (Future SDO 3.0)

To be honest, I am not familiar with the use case of duration type and
based on SDO-189, it seems there is more work on the future SDO spec
work.

For now, I suggest to open a JIRA to implement duration to date
conversion based on SDO-95.

What do you think?

Fuhwei Lwo

Andy Grove <[EMAIL PROTECTED]> wrote: I've been looking at the
DateConversionTest.testToDateFormats test in the SDO CTS. The test
iterates over a list of valid date format strings and calls
DataHelper.toDate() for each one.
 
However, the test is only asserting that the returned date is not null
rather than checking that the correct date is returned.
 
I am in the process of expanding this test to check the returned date
but I have some questions about what the expected date is for formats
using duration types.
 
The SDO specification doesn't provide much detail on handling of
duration types but here are a few examples of how Tuscany is currently
mapping SDO date format strings to Java dates:
 
P2006Y 08M 10D T 12H 24M 07S gets converted to
2006-08-10T11:24:07.000GMT which seems pretty reasonable.
 
P2006Y 10D T 12H gets converted to P2006Y 10D T 12H which again seems
reasonable.
 
The conversions I don't understand are:
 
-P2006Y 08M 10D T 07S.2 gets converted to 1933-05-25T00:59:52.998GMT
 
-P 04M 10DT12H 24S.88 gets converted to 1932-09-23T12:59:35.912GMT
 
I'm not sure if these are the expected values or if I should file a JIRA
against the CTS?
 
Thanks,
 
Andy.
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to