5152535455565758596061
public void test1() { Pool pool = new StrictMaxPool(); int maxSize = 10; long timeout = 100; pool.initialize(container, maxSize, timeout); BeanContext<?> ctx = pool.get(); pool.remove(ctx); assertEquals(0, pool.getCurrentSize());
6566676869707172737475
public void test2() { Pool pool = new StrictMaxPool(); int maxSize = 10; long timeout = 100; pool.initialize(container, maxSize, timeout); for(int i = 0; i < maxSize; i++) pool.get(); assertEquals(maxSize, pool.getCurrentSize());
8990919293949596979899
public void test3() { Pool pool = new StrictMaxPool(); int maxSize = 10; long timeout = 100; pool.initialize(container, maxSize, timeout); BeanContext<?> ctxs[] = new BeanContext[maxSize]; for(int i = 0; i < maxSize; i++) ctxs[i] = pool.get();
6061626364656667686970
{ ThreadlocalPool pool = new ThreadlocalPool(); Container container = new MockContainer(); int maxSize = -1; int timeout = -1; pool.initialize(container, maxSize, timeout); BeanContext ctx = pool.get(); pool.release(ctx); ctx = null;
8384858687888990919293
{ ThreadlocalPool pool = new ThreadlocalPool(); Container container = new MockContainer(); int maxSize = -1; int timeout = -1; pool.initialize(container, maxSize, timeout); assertEquals(0, pool.getAvailableCount()); BeanContext ctx = pool.get();
107108109110111112113114115116117
{ final ThreadlocalPool pool = new ThreadlocalPool(); Container container = new MockContainer(); int maxSize = -1; int timeout = -1; pool.initialize(container, maxSize, timeout); Runnable r = new Runnable() { public void run() {
152153154155156157158159160161162