130131132133134135136137138139140
waitFinished(2); assertEquals(threadNames.get("test1"), threadNames.get("test2")); } finally { pool.stop(true); } } /** * Test multiple pooling
153154155156157158159160161162163
waitFinished(2); assertTrue("Shouldn't run on the same thread", threadNames.get("test1").equals(threadNames.get("test2")) == false); } finally { pool.stop(true); } } /** * Test maximum pool
178179180181182183184185186187188
waitFinished(2); assertEquals(makeExpected(new Object[] {"test1", "test2"}), finishedRunnables); } finally { pool.stop(true); } } /** * Test maximum cache
214215216217218219220221222223224
waitFinished(2); assertEquals(makeExpected(new Object[] {"test1", "test2"}), finishedRunnables); } finally { pool.stop(true); } } /** * Test runnable timeouts
238239240241242243244245246247248
waitFinished(1); assertEquals(makeExpected(new Object[] {"test1"}), finishedRunnables); } finally { pool.stop(true); } } /** * Test runnable timeouts
267268269270271272273274275276277
waitFinished(1); assertEquals(makeExpected(new Object[] {"test2"}), finishedRunnables); } finally { pool.stop(true); } } /** * Test runnable timeouts
298299300301302303304305306307308
Thread.sleep(3000); assertEquals(makeExpected(tmp.toArray()), finishedRunnables); } finally { pool.stop(true); } } /** * Save the thread name