07-08-05 12:45 PM
Hi Michael,
as Andy pointed out, this is a date parsing error. You find the error
stack trace in TEST-javax.jdo.identity.ObjectIdentityTest.txt under
target/test-reports.
The JDOImplHelper parses Date string using a DateFormat instance
retrieved by calling DateFormat.getDateTimeInstance. The no-arg version
of getDateTimeInstance uses the default locale which is different for
Craig and you (Locale.US vs. Locale.GERMANY). The ObjectIdentityTest
specifies date strings in US format: 'Jan 01, 1970 00:00:00 AM' which
does not parse with a DateFormat using the German locale.
A possible solution could be using the US locale when creating the
DateFormat. Replace dateFormat definition on line 94 of JDOImplHelper
with the following line:
static DateFormat dateFormat = DateFormat.getDateTimeInstance(
DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US);
Then all the test cases pass. The downside is that this hard codes the
US locale in the JDOImplHelper code. Maybe the JDOImplHelper could use
the US locale as the default, but provide a way to override this. It
already provides a method registerDateFormat to override the
dateFormatPattern, but this needs to be in sync with the locale of the
dateFormat instance.
Regards Michael
>
>You mean the failed test ?
>This is the error. Looks like some date parsing needs a fix in JDOImplHelpe
r.
>
>javax.jdo.JDOUserException: Error parsing Date string "Jan 01, 1970 00:00:0
0
>AM" at position 0 using date format "MMM d, yyyy hh:mm:ss a".
>at javax.jdo.spi.JDOImplHelper$3.construct(JDOImplHelper.java:580)
> at javax.jdo.spi.JDOImplHelper.construct(JDOImplHelper.java:610)
> at javax.jdo.identity.ObjectIdentity.<init>(ObjectIdentity.java:86)
> at
>javax.jdo.identity.ObjectIdentityTest.testStringDateConstructor(ObjectIdent
ityTest.java:202)
>
>
>HTH
>
>
--
Michael Bouschen Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de http://www.tech.spree.de/
Tel.:++49/30/235 520-33 Buelowstr. 66
Fax.:++49/30/2175 2012 D-10783 Berlin
[ Post a follow-up to this message ]
|