persist(task1);
persist(task2);
persist(task3);
final TaskFetcher taskFetcher = new TaskFetcher(em);
UserRoles ur = new UserRoles("niko",
new String[] { "examples\\employee" });
Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
Task[] t2 = taskFetcher.fetchAvailableTasks(ur, PATask.class,
"T._state = TaskState.READY OR T._state = TaskState.CLAIMED");
UserRoles ur2 = new UserRoles("alex",
new String[] { "examples\\employee2" });
Task[] t3 = taskFetcher.fetchAvailableTasks(ur2, PATask.class,
"T._state = TaskState.READY OR T._state = TaskState.CLAIMED");
Assert.assertEquals(3, t1.length);