use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class ManagementServiceTest method testDeleteJobDeletion.
@Deployment(resources = { "org/activiti/engine/test/api/mgmt/timerOnTask.bpmn20.xml" })
public void testDeleteJobDeletion() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("timerOnTask");
Job timerJob = managementService.createJobQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull("Task timer should be there", timerJob);
managementService.deleteJob(timerJob.getId());
timerJob = managementService.createJobQuery().processInstanceId(processInstance.getId()).singleResult();
assertNull("There should be no job now. It was deleted", timerJob);
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class ManagementServiceTest method testSetJobRetries.
@Deployment(resources = { "org/activiti/engine/test/api/mgmt/ManagementServiceTest.testGetJobExceptionStacktrace.bpmn20.xml" })
public void testSetJobRetries() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("exceptionInJobExecution");
// The execution is waiting in the first usertask. This contains a boundary
// timer event.
Job timerJob = managementService.createJobQuery().processInstanceId(processInstance.getId()).singleResult();
Date duedate = timerJob.getDuedate();
assertNotNull("No job found for process instance", timerJob);
assertEquals(JobEntity.DEFAULT_RETRIES, timerJob.getRetries());
managementService.setJobRetries(timerJob.getId(), 5);
timerJob = managementService.createJobQuery().processInstanceId(processInstance.getId()).singleResult();
assertEquals(5, timerJob.getRetries());
assertEquals(duedate, timerJob.getDuedate());
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class EventSubscriptionQueryTest method testQueryByExecutionId.
@Deployment
public void testQueryByExecutionId() {
// starting two instances:
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("catchSignal");
runtimeService.startProcessInstanceByKey("catchSignal");
// test query by process instance id
EventSubscriptionEntity subscription = newEventSubscriptionQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(subscription);
Execution executionWaitingForSignal = runtimeService.createExecutionQuery().activityId("signalEvent").processInstanceId(processInstance.getId()).singleResult();
// test query by execution id
EventSubscriptionEntity signalSubscription = newEventSubscriptionQuery().executionId(executionWaitingForSignal.getId()).singleResult();
assertNotNull(signalSubscription);
assertEquals(signalSubscription, subscription);
cleanDb();
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class ProcessInstanceIdentityLinkTest method testSetAuthenticatedUserAndCompleteLastTask.
// Test specific for fix introduced by https://activiti.atlassian.net/browse/ACT-1591
// (Referential integrity constraint violation on PROC_INST and IDENTITY_LINK)
@Deployment
public void testSetAuthenticatedUserAndCompleteLastTask() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("identityLinktest");
// There are two tasks
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
taskService.complete(task.getId());
identityService.setAuthenticatedUserId("kermit");
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
taskService.complete(task.getId());
identityService.setAuthenticatedUserId(null);
assertProcessEnded(processInstance.getId());
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class ProcessInstanceIdentityLinkTest method testSetAuthenticatedUserWithNoWaitStates.
// Test specific for fix introduced by https://activiti.atlassian.net/browse/ACT-1591
// (Referential integrity constraint violation on PROC_INST and IDENTITY_LINK)
@Deployment
public void testSetAuthenticatedUserWithNoWaitStates() {
identityService.setAuthenticatedUserId("kermit");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("identityLinktest");
assertProcessEnded(processInstance.getId());
identityService.setAuthenticatedUserId(null);
}
Aggregations