GetTaskRequestEvent event = new GetTaskRequestEvent("1234567");
event.setRequestJobCount(3);
jobManager.getUnDoJobTasks(event);
GetTaskResponseEvent eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
Assert.assertEquals(event.getSequence(), eventresp.getSequence());
Assert.assertEquals(3, eventresp.getJobTasks().size());
//验证没有任务
event = new GetTaskRequestEvent("12345678");
event.setRequestJobCount(3);
jobManager.getUnDoJobTasks(event);
eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
Assert.assertEquals(event.getSequence(), eventresp.getSequence());
Assert.assertEquals(0, eventresp.getJobTasks().size());
//任务被回收
Thread.sleep(21 * 1000);
//验证一共3个任务
jobManager.checkJobStatus();
event = new GetTaskRequestEvent("12345679");
event.setRequestJobCount(3);
jobManager.getUnDoJobTasks(event);
eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
Assert.assertEquals(event.getSequence(), eventresp.getSequence());
Assert.assertEquals(3, eventresp.getJobTasks().size());
Assert.assertEquals(1,eventresp.getJobTasks().get(0).getRecycleCounter().get());
}