[
http://jira.jboss.com/jira/browse/JBRULES-1525?page=all ]
Nicolas Heron updated JBRULES-1525:
-----------------------------------
Attachment: DateFactory.java.patch
Hello again,
in fact the main problem is that you guys are all using US as a country and english as a
language.
We poor others, don't use it.
So all the tests and drl files you are assuming that date is format DD-MM-YYYY
To correct this,I modified the class DateFactory
in package org.drools.base.evaluators of drools-core.
Before, you were initializing the simple parser like this :
return new SimpleDateFormat( DateFactory.DATE_FORMAT_MASK );
now I propose :
DateFormatSymbols dateSymbol =
new DateFormatSymbols( new Locale( DateFactory.DEFINE_LANGUAGE,
DateFactory.DEFINE_COUNTRY ) )
SimpleDateFormat dateFormat = new SimpleDateFormat(
DateFactory.DATE_FORMAT_MASK,
dateSymbol );
return dateFormat;
Here I first initialize a DateFormatSymbols and use it when creating the simple parse.
By defautl, it is "en" as language and "US" as country
and you can modify it by setting two system properties
drools.defaultlanguage and drools.defaultcountry
Now all tests concerning date format work for whatever coutry you are.
And by the way, you don't need the patch submitted by jan Boboli that modifies the
test.
The present solution is I thing more modular.
Regards
Nicolas Héron
MVELCalendarCoercionTest and MVELDateCoercionTest do not passed on
4.0.x
------------------------------------------------------------------------
Key: JBRULES-1525
URL:
http://jira.jboss.com/jira/browse/JBRULES-1525
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 4.0.5
Environment: Maven 2.0.8, Java 5, Linux Mandriva 2008.0
Reporter: Nicolas Heron
Assigned To: Mark Proctor
Fix For: 4.0.6
Attachments: DateFactory.java.patch, export.txt, export2.txt,
MVELCalendarCoercionTest.patch, MVELDateCoercionTest.patch, surefire-reports.tar.gz
I took the latest 4.0.x version and did everything needed to build the solution but
When using maven, I always have the same errors in those 2 tests :
testString(org.drools.base.mvel.MVELCalendarCoercionTest)
testString(org.drools.base.mvel.MVELDateCoercionTest)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira