use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByNameInIgnoreCase.
public void testQueryByNameInIgnoreCase() {
final List<String> taskNameList = new ArrayList<String>(2);
taskNameList.add("testtask");
taskNameList.add("gonzotask");
TaskQuery query = taskService.createTaskQuery().taskNameInIgnoreCase(taskNameList);
assertEquals(7, query.list().size());
assertEquals(7, query.count());
try {
query.singleResult();
fail("expected exception");
} catch (ActivitiException e) {
// OK
}
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByPriority.
public void testQueryByPriority() {
TaskQuery query = taskService.createTaskQuery().taskPriority(10);
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ActivitiException e) {
}
query = taskService.createTaskQuery().taskPriority(100);
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
query = taskService.createTaskQuery().taskMinPriority(50);
assertEquals(3, query.list().size());
query = taskService.createTaskQuery().taskMinPriority(10);
assertEquals(5, query.list().size());
query = taskService.createTaskQuery().taskMaxPriority(10);
assertEquals(9, query.list().size());
query = taskService.createTaskQuery().taskMaxPriority(3);
assertEquals(6, query.list().size());
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByPriorityOr.
public void testQueryByPriorityOr() {
TaskQuery query = taskService.createTaskQuery().or().taskId("invalid").taskPriority(10);
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ActivitiException e) {
}
query = taskService.createTaskQuery().or().taskId("invalid").taskPriority(100);
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
query = taskService.createTaskQuery().or().taskId("invalid").taskMinPriority(50);
assertEquals(3, query.list().size());
query = taskService.createTaskQuery().or().taskId("invalid").taskMinPriority(10);
assertEquals(5, query.list().size());
query = taskService.createTaskQuery().or().taskId("invalid").taskMaxPriority(10);
assertEquals(9, query.list().size());
query = taskService.createTaskQuery().or().taskId("invalid").taskMaxPriority(3);
assertEquals(6, query.list().size());
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByNameOr.
public void testQueryByNameOr() {
TaskQuery query = taskService.createTaskQuery().or().taskName("testTask").taskId("invalid");
assertEquals(6, query.list().size());
assertEquals(6, query.count());
try {
query.singleResult();
fail("expected exception");
} catch (ActivitiException e) {
// OK
}
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByInvalidTaskId.
public void testQueryByInvalidTaskId() {
TaskQuery query = taskService.createTaskQuery().taskId("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
taskService.createTaskQuery().taskId(null);
fail("expected exception");
} catch (ActivitiIllegalArgumentException e) {
// OK
}
}
Aggregations