161162163164165166167168169170171
public void run() { for(int i = 0; i < 10; i++) { BeanContext ctx = pool.get(); pool.release(ctx); ctx = null; used++; } }
211212213214215216217218219220221
for(int i = 0; i < 10; i++) { BeanContext ctx = pool.get(); BeanContext ctx2 = pool.get(); pool.release(ctx2); ctx2 = null; used ++; pool.release(ctx); ctx = null;
215216217218219220221222223224225
pool.release(ctx2); ctx2 = null; used ++; pool.release(ctx); ctx = null; used ++; } } };
6263646566676869707172
Container container = new MockContainer(); int maxSize = -1; int timeout = -1; pool.initialize(container, maxSize, timeout); BeanContext ctx = pool.get(); pool.release(ctx); ctx = null; gc(); assertEquals(0, pool.getRemoveCount());
90919293949596979899100
Runnable r = new Runnable() { public void run() { BeanContext ctx = pool.get(); pool.release(ctx); ctx = null; used++; } };
137138139140141142143144145146147
187188189190191192193194195196197
191192193194195196197198199200201