}
@Test
public void testGetExpectedExecutorForName() throws Exception {
Map<String, Object> cache = new HashMap<String, Object>();
ThreadPoolBuilder builder =
new ThreadPoolBuilder(name.getTableNameString(), new Configuration(false));
ThreadPoolExecutor exec = ThreadPoolManager.getExecutor(builder, cache);
assertNotNull("Got a null exector from the pool!", exec);
ThreadPoolExecutor exec2 = ThreadPoolManager.getExecutor(builder, cache);
assertTrue("Got a different exectuor, even though they have the same name", exec2 == exec);
builder = new ThreadPoolBuilder(name.getTableNameString(), new Configuration(false));
exec2 = ThreadPoolManager.getExecutor(builder, cache);
assertTrue(
"Got a different exectuor, even though they have the same name, but different confs",
exec2 == exec);
builder =
new ThreadPoolBuilder(name.getTableNameString() + "-some-other-pool", new Configuration(
false));
exec2 = ThreadPoolManager.getExecutor(builder, cache);
assertFalse(
"Got a different exectuor, even though they have the same name, but different confs",
exec2 == exec);