use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByInvalidNameOr.
public void testQueryByInvalidNameOr() {
TaskQuery query = taskService.createTaskQuery().or().taskId("invalid").taskName("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
taskService.createTaskQuery().or().taskId("invalid").taskName(null).singleResult();
fail("expected exception");
} catch (ActivitiIllegalArgumentException e) {
// OK
}
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByInvalidDescriptionLike.
public void testQueryByInvalidDescriptionLike() {
TaskQuery query = taskService.createTaskQuery().taskDescriptionLike("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
taskService.createTaskQuery().or().taskId("invalid").taskDescriptionLike(null).list();
fail();
} catch (ActivitiIllegalArgumentException e) {
}
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryCreatedBefore.
public void testQueryCreatedBefore() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");
// Should result in 7 tasks
Date before = sdf.parse("03/02/2002 02:02:02.000");
TaskQuery query = taskService.createTaskQuery().taskCreatedBefore(before);
assertEquals(7, query.count());
assertEquals(7, query.list().size());
before = sdf.parse("01/01/2001 01:01:01.000");
query = taskService.createTaskQuery().taskCreatedBefore(before);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryCreatedAfterOr.
public void testQueryCreatedAfterOr() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");
// Should result in 3 tasks
Date after = sdf.parse("03/03/2003 03:03:03.000");
TaskQuery query = taskService.createTaskQuery().or().taskId("invalid").taskCreatedAfter(after);
assertEquals(3, query.count());
assertEquals(3, query.list().size());
after = sdf.parse("05/05/2005 05:05:05.000");
query = taskService.createTaskQuery().or().taskId("invalid").taskCreatedAfter(after);
assertEquals(0, query.count());
assertEquals(0, query.list().size());
}
use of org.activiti.engine.task.TaskQuery in project Activiti by Activiti.
the class TaskQueryTest method testQueryByInvalidNameInIgnoreCase.
public void testQueryByInvalidNameInIgnoreCase() {
final List<String> taskNameList = new ArrayList<String>(1);
taskNameList.add("invalid");
TaskQuery query = taskService.createTaskQuery().taskNameInIgnoreCase(taskNameList);
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
taskService.createTaskQuery().or().taskId("invalid").taskNameIn(null).singleResult();
fail("expected exception");
} catch (ActivitiIllegalArgumentException e) {
// OK
}
}
Aggregations