08-22-2014 03:12 AM
08-25-2014 01:55 AM
08-25-2014 03:01 AM
08-26-2014 01:20 AM
public void testClaimAlreadyClaimedTaskByOtherUser() {
Task task = taskService.newTask();
taskService.saveTask(task);
User user = identityService.newUser("user");
identityService.saveUser(user);
User secondUser = identityService.newUser("seconduser");
identityService.saveUser(secondUser);
// Claim task the first time
taskService.claim(task.getId(), user.getId());
try {
taskService.claim(task.getId(), secondUser.getId());
fail("ActivitiException expected");
} catch (ActivitiTaskAlreadyClaimedException ae) {
assertTextPresent("Task '" + task.getId() + "' is already claimed by someone else.", ae.getMessage());
}
taskService.deleteTask(task.getId(), true);
identityService.deleteUser(user.getId());
identityService.deleteUser(secondUser.getId());
}
public void testClaimAlreadyClaimedTaskBySameUser() {
Task task = taskService.newTask();
taskService.saveTask(task);
User user = identityService.newUser("user");
identityService.saveUser(user);
// Claim task the first time
taskService.claim(task.getId(), user.getId());
task = taskService.createTaskQuery().taskId(task.getId()).singleResult();
// Claim the task again with the same user. No exception should be thrown
taskService.claim(task.getId(), user.getId());
taskService.deleteTask(task.getId(), true);
identityService.deleteUser(user.getId());
}
public void testUnClaimTask() {
Task task = taskService.newTask();
taskService.saveTask(task);
User user = identityService.newUser("user");
identityService.saveUser(user);
// Claim task the first time
taskService.claim(task.getId(), user.getId());
task = taskService.createTaskQuery().taskId(task.getId()).singleResult();
assertEquals(user.getId(), task.getAssignee());
// Unclaim the task
taskService.unclaim(task.getId());
task = taskService.createTaskQuery().taskId(task.getId()).singleResult();
assertNull(task.getAssignee());
taskService.deleteTask(task.getId(), true);
identityService.deleteUser(user.getId());
}
08-28-2014 08:27 AM
02-21-2015 05:49 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.