[
http://jira.jboss.com/jira/browse/JBPM-1146?page=comments#action_12403221 ]
Len DiMaggio commented on JBPM-1146:
------------------------------------
Using the patched build.xml file - all the tests in the
org.jbpm.calendar.BusinessCalendarTest class pass.
FYI - I'm seeing the same results with/without the patch:
ant test
Buildfile: build.xml
compile.jbpm:
compile.identity:
compile.jbpm.test:
test.jbpm:
[junit] Running org.jbpm.AllTests
[junit] Tests run: 872, Failures: 1, Errors: 0, Time elapsed: 43.006 sec
[junit] Test org.jbpm.AllTests FAILED
[junitreport] Transform time: 54895ms
compile.identity.test:
test.identity:
[junit] Running org.jbpm.identity.xml.IdentityXmlParsingTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.255 sec
[junit] Tests run: 15, Failures: 0, Errors: 1, Time elapsed: 6.094 sec
[junit] TEST org.jbpm.identity.assignment.ExpressionAssignmentHandlerTest FAILED
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.287 sec
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.221 sec
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.015 sec
[junit] Tests FAILED
[junitreport] Transform time: 51983ms
test:
BUILD SUCCESSFUL
Total time: 2 minutes 47 seconds
Package org.jbpm.calendar
Name Tests Errors Failures Time(s)
BusinessCalendarTest 12 0 0 0.015
DayPartTest 3 0 0 0.005
DayTest 3 0 0 0.004
HolidayTest 2 0 0 0.004
Leap Year Date Calculations (v3.1.4)
------------------------------------
Key: JBPM-1146
URL:
http://jira.jboss.com/jira/browse/JBPM-1146
Project: JBoss jBPM
Issue Type: Support Patch
Components: Core Engine
Affects Versions: jBPM 3.1.4
Reporter: Alejandro Guizar
Assigned To: Len DiMaggio
Attachments: jbpm-3.1.4.jar
Based on JBPM-1098 there is concern over date calculations in in jBPM 3.1 and 3.2. There
might be issues around the end of Feb. The problem is characterized as follows. Under the
current model, durations that are not expressed in months or years work correctly.
Consider the following expression.
endDate = new Date(startDate.getTime() + interval);
If startDate is February 28, 2008 and interval is 1 day, then endDate will be February
29, 2008. Every day has the same duration even on leap years. The presentation layer is
responsible of converting the milliseconds in a Date to a suitable representation in the
calendar system. The Java APIs are all aware of leap years, so this is covered as well.
The situation is different for months and years. If the interval above was 1 year, then
endDate would be February 27, 2009. Because of the extra day in 2008, the expected endDate
has shifted backwards one day. To fix this, the Duration class has to preserve the
original unit of time instead of converting to milliseconds up front. Calculation of
endDate can then be delegated to java.util.Calendar as follows.
startCalendar = Calendar.getInstance();
startCalendar.setTime(startDate);
startCalendar.add(unit, interval);
endDate = startCalendar.getTime();
--
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