* Test scale through number of tasks and number of threads.
*/
@Test (timeout=1000)
public void addAndConsumeManyTasks() throws Exception {
SchedulerQueue queue = getQueueInstance();
for (int i = 0; i < 537; i++)
queue.addTask(new ScheduledTaskImpl(50));
for (int i = 0; i < 679; i++)
queue.addTask(new ScheduledTaskImpl());
int count = 0;
while (queue.getNextTask(false) != null)
count++;
Thread.sleep(100);
while (queue.getNextTask(false) != null)
count++;
assertEquals(1216, count);
}