[jbpm-commits] JBoss JBPM SVN: r5625 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Sep 9 10:17:07 EDT 2009
Author: jbarrez
Date: 2009-09-09 10:17:07 -0400 (Wed, 09 Sep 2009)
New Revision: 5625
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java
Log:
Test for JBPM-2517
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java 2009-09-09 13:05:35 UTC (rev 5624)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java 2009-09-09 14:17:07 UTC (rev 5625)
@@ -21,6 +21,8 @@
*/
package org.jbpm.test.timer;
+import java.util.Calendar;
+
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.job.Job;
import org.jbpm.test.JbpmTestCase;
@@ -57,5 +59,43 @@
managementService.executeJob(job.getId());
assertProcessInstanceEnded(processInstance);
}
+
+ /**
+ * Test case for https://jira.jboss.org/jira/browse/JBPM-2517
+ *
+ * In this issue, it is stated that the calculations for the timer
+ * will overflow if larger than 4 weeks due to integer limitations.
+ */
+ public void testTimerFarInFuture() {
+ deployJpdlXmlString(
+ "<process name='theProcess'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b' />" +
+ " <transition name='timeout' to='escalate'>" +
+ " <timer duedate='750 years' />" +
+ " </transition>" +
+ " </state>" +
+ " <state name='b' />" +
+ " <end name='escalate' />" +
+ "</process>"
+ );
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("theProcess");
+
+ Calendar now = Calendar.getInstance();
+ int currentYear = now.get(Calendar.YEAR);
+
+ Job job = managementService.createJobQuery()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult();
+
+ Calendar jobDate = Calendar.getInstance();
+ jobDate.setTime(job.getDuedate());
+
+ assertEquals(currentYear + 750, jobDate.get(Calendar.YEAR));
+ }
+
}
\ No newline at end of file
More information about the jbpm-commits
mailing list