@Test
public void testQueueOverflow() throws InterruptedException
{
TestTargetTransportPort port = new TestTargetTransportPort(null, true);
List<TestTask> taskSet = new ArrayList<TestTask>();
Nexus nexus = new Nexus("initiator", "target", 0);
TaskSet set = new DefaultTaskSet(LIMITING_SET_QUEUE_DEPTH);
for (int i = 0; i < LIMITING_SET_QUEUE_DEPTH; i++)
{
set.offer(new SimpleTask(port, new Nexus(nexus, i), taskSet, 0));
}
// Offer one too many tasks to task queue
boolean result =
set.offer(new SimpleTask(port, new Nexus(nexus, LIMITING_SET_QUEUE_DEPTH + 1), taskSet,
0));
assertTrue("Task set accepted too many tasks", !result);
assertEquals("Task set did not report TASK SET FULL condition to transport",