101102103104105106107108109110111
assertEquals(expected, started.tasks); assertEquals(expected, completed.tasks); } finally { pool.stop(true); } } /** * Multiple Basic test
124125126127128129130131132133134
assertEquals(expected, started.tasks); assertEquals(expected, completed.tasks); } finally { pool.stop(true); } } /** * Test pooling
145146147148149150151152153154155
completed.wait(2); assertEquals(threadNames.get("test1"), threadNames.get("test2")); } finally { pool.stop(true); } } /** * Test multiple pooling
167168169170171172173174175176177
completed.wait(2); assertTrue("Shouldn't run on the same thread", threadNames.get("test1").equals(threadNames.get("test2")) == false); } finally { pool.stop(true); } } /** * Test maximum pool
191192193194195196197198199200201
completed.wait(2); assertEquals(makeExpected(new Object[] {"test1", "test2"}), completed.tasks); } finally { pool.stop(true); } } /** * Test maximum cache
218219220221222223224225226227228
272273274275276277278279280281282
stopped.wait(1); completed.wait(1); } finally { pool.stop(true); } } public void testCompleteTimeoutWithSpinLoop() throws Exception {
296297298299300301302303304305306
stopped.wait(1); completed.wait(1); } finally { pool.stop(true); } } /** * Save the thread name
8687888990919293949596
HashSet expected = makeExpected(new Object[] {"test"}); assertEquals(expected, finishedRunnables); } finally { pool.stop(true); } } /** * Multiple Basic test
108109110111112113114115116117118
HashSet expected = makeExpected(new Object[] {"test1", "test2", "test3"}); assertEquals(expected, finishedRunnables); } finally { pool.stop(true); } } /** * Test pooling