// Allocate up to max tasks
for (int i = 0; i < MAX_TASKS; i++) {
Priority priority = Priority.newInstance(20);
requestHandler.addAllocateTaskRequest(new Long(i), null, priority, null);
requestHandler.processRequest();
}
// Only MAX_TASKS number of tasks should have been allocated
Assert.assertEquals("Wrong number of allocate tasks", MAX_TASKS, taskAllocations.size());
Assert.assertTrue("Another allocation should not fit", requestHandler.shouldWait());