Author: alex.guizar(a)jboss.com
Date: 2010-08-19 23:21:28 -0400 (Thu, 19 Aug 2010)
New Revision: 6616
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timer/IntermediateTimerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timerstart/TimerStartTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java
Log:
remove unintended JbpmTestCase dependency on JMS API;
replace deprecated Job.getDuedate() calls with Job.getDueDate()
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timer/IntermediateTimerTest.java
===================================================================
---
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timer/IntermediateTimerTest.java 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timer/IntermediateTimerTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -56,7 +56,7 @@
Job timerJob = managementService.createJobQuery()
.processInstanceId(processInstance.getId())
.uniqueResult();
- assertEquals(timerJob.getDuedate().getTime(), new Date(60 * 60 *1000).getTime());
+ assertEquals(timerJob.getDueDate().getTime(), new Date(60 * 60 *1000).getTime());
managementService.executeJob(timerJob.getId());
assertProcessInstanceEnded(processInstance);
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timerstart/TimerStartTest.java
===================================================================
---
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timerstart/TimerStartTest.java 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/timerstart/TimerStartTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -56,20 +56,20 @@
// After deployment, there should be one job in the database that starts a new
process instance
Job startProcessTimer = managementService.createJobQuery().uniqueResult();
assertNotNull(startProcessTimer);
- assertEquals(DateUtils.getDate(10, Calendar.OCTOBER, 2099, 10, 0, 0).getTime(),
startProcessTimer.getDuedate().getTime());
+ assertEquals(DateUtils.getDate(10, Calendar.OCTOBER, 2099, 10, 0, 0).getTime(),
startProcessTimer.getDueDate().getTime());
// Triggering the job should start a new process instance of the deployed process
definition
ProcessInstanceQuery procInstQuery = executionService.createProcessInstanceQuery();
assertEquals(0, procInstQuery.count());
- // need to change current date to calculate the next duedate internally correctl
+ // need to change current date to calculate the next due date internally correctly
Clock.setExplicitTime(DateUtils.getDate(10, Calendar.OCTOBER, 2099, 10, 0, 0));
managementService.executeJob(startProcessTimer.getId());
assertEquals(1, procInstQuery.count());
- // Since a timeCycle was used, the job should have been recreated with a new duedate
+ // Since a timeCycle was used, the job should have been recreated with a new due
date
startProcessTimer = managementService.createJobQuery().uniqueResult();
- assertEquals(DateUtils.getDate(10, Calendar.OCTOBER, 2099, 20, 0, 0).getTime(),
startProcessTimer.getDuedate().getTime());
+ assertEquals(DateUtils.getDate(10, Calendar.OCTOBER, 2099, 20, 0, 0).getTime(),
startProcessTimer.getDueDate().getTime());
// So we need to manually delete it
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
===================================================================
---
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -58,7 +58,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- long difference = job.getDuedate().getTime() - now;
+ long difference = job.getDueDate().getTime() - now;
// we do not know when this test will be run. So the exact actual duedate of the
timer
// can not be calculated easily. But we do know for sure that each working day only
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2010-08-20
03:14:27 UTC (rev 6615)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -27,7 +27,6 @@
import java.util.Timer;
import java.util.TimerTask;
-import javax.jms.Message;
import javax.jms.Session;
import org.hibernate.criterion.Projections;
@@ -111,16 +110,16 @@
}
}
- public static Message jmsConsumeMessage(String connectionFactoryName, String
destinationName) {
+ public static Object jmsConsumeMessage(String connectionFactoryName, String
destinationName) {
return jmsConsumeMessage(connectionFactoryName, destinationName,
Session.AUTO_ACKNOWLEDGE);
}
- public static Message jmsConsumeMessage(String connectionFactoryName, String
destinationName,
+ public static Object jmsConsumeMessage(String connectionFactoryName, String
destinationName,
int acknowledgeMode) {
return jmsConsumeMessage(connectionFactoryName, destinationName, acknowledgeMode,
5000);
}
- public static Message jmsConsumeMessage(String connectionFactoryName, String
destinationName,
+ public static Object jmsConsumeMessage(String connectionFactoryName, String
destinationName,
int acknowledgeMode, long timeout) {
return JmsExtensions.consumeMessage(connectionFactoryName,
destinationName,
Modified:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java
===================================================================
---
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/cfg/CustomBusinessCalendarCfgTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -71,7 +71,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- Date duedate = job.getDuedate();
+ Date duedate = job.getDueDate();
gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTime(duedate);
Modified:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java
===================================================================
---
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/cal/impl/CustomBusinessCalendarImplTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -65,10 +65,10 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- Date duedate = job.getDuedate();
+ Date dueDate = job.getDueDate();
GregorianCalendar gregorianCalendar = new GregorianCalendar();
- gregorianCalendar.setTime(duedate);
+ gregorianCalendar.setTime(dueDate);
assertEquals(Calendar.JULY, gregorianCalendar.get(Calendar.MONTH));
assertEquals(21, gregorianCalendar.get(Calendar.DAY_OF_MONTH));
}
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 2010-08-20
03:14:27 UTC (rev 6615)
+++
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java 2010-08-20
03:21:28 UTC (rev 6616)
@@ -121,7 +121,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
assertEquals(currentYear + 10, jobDate.get(Calendar.YEAR));
}
@@ -154,7 +154,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
assertEquals(cal.get(Calendar.DAY_OF_MONTH), jobDate.get(Calendar.DAY_OF_MONTH));
@@ -190,7 +190,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
assertEquals(cal.get(Calendar.DAY_OF_MONTH), jobDate.get(Calendar.DAY_OF_MONTH));
@@ -224,7 +224,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- Date jobDate = job.getDuedate();
+ Date jobDate = job.getDueDate();
assertTrue("should less than 2 minutes", jobDate.getTime() - new
Date().getTime() <= 2 * 60 * 1000);
managementService.executeJob(job.getId());
@@ -259,7 +259,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
cal.add(Calendar.DAY_OF_MONTH, 5);
assertEquals(cal.get(Calendar.DAY_OF_MONTH), jobDate.get(Calendar.DAY_OF_MONTH));
@@ -297,7 +297,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
// 6 days from now minus 5 days is tomorrow so subtract 5 from the original added 6.
cal.add(Calendar.DAY_OF_MONTH, -5);
@@ -335,7 +335,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
// 12 feb is friday, 5 businessdays further is friday 19th
assertEquals(19 , jobDate.get(Calendar.DAY_OF_MONTH));
@@ -397,7 +397,7 @@
.uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
// 17 feb is friday, 5 businessdays before is friday 10th
assertEquals(10 , jobDate.get(Calendar.DAY_OF_MONTH));
@@ -432,7 +432,7 @@
Job job =
managementService.createJobQuery().processInstanceId(processInstance.getId()).uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
// 5 mar is monday, 5 businessdays before is monday feb 27th (29-02-12 is leap day)
assertEquals(27, jobDate.get(Calendar.DAY_OF_MONTH));
@@ -467,7 +467,7 @@
Job job =
managementService.createJobQuery().processInstanceId(processInstance.getId()).uniqueResult();
Calendar jobDate = Calendar.getInstance();
- jobDate.setTime(job.getDuedate());
+ jobDate.setTime(job.getDueDate());
// 13 mar is tuesday, 10 businessdays before is tuesday feb 28th (29-02-12 is leap
day)
assertEquals(28, jobDate.get(Calendar.DAY_OF_MONTH));