* Test maximum cache
*/
public void testMaximumQueue() throws Exception
{
log.debug("testMaximumQueue");
BasicThreadPool pool = new BasicThreadPool();
pool.setMaximumQueueSize(1);
pool.setMaximumPoolSize(1);
try
{
pool.run(new TestRunnable(HOLD_START, "test1"));
waitStarted(1);
pool.run(new TestRunnable(BASIC, "test2"));
boolean caught = false;
try
{
pool.run(new TestRunnable(BASIC, "test3"));
}
catch (ThreadPoolFullException expected)
{
caught = true;
}
assertTrue("Expected ThreadPoolFullException", caught);
releaseStarted("test1");
waitFinished(2);
assertEquals(makeExpected(new Object[] {"test1", "test2"}), finishedRunnables);
}
finally
{
pool.stop(true);
}
}