Package org.apache.commons.pool.impl

Examples of org.apache.commons.pool.impl.StackObjectPool.borrowObject()


        TypedPoolableObjectFactory<MockObject> factory = TypedPoolableObjectFactory.makeFactory(MockObject.class, true);
        assertNotNull(factory);
       
        StackObjectPool pool = new StackObjectPool(factory);
       
        MockObject obj = (MockObject)pool.borrowObject();
        assertNotNull(obj);
        assertTrue(obj.isInitialized());
    }
   
    /**
 
View Full Code Here


        TypedPoolableObjectFactory<MockObjectWithArgs> factory = TypedPoolableObjectFactory.makeFactory(MockObjectWithArgs.class, true, expected0, expected1);
        assertNotNull(factory);
       
        StackObjectPool pool = new StackObjectPool(factory);
       
        MockObjectWithArgs obj = (MockObjectWithArgs)pool.borrowObject();
        assertNotNull(obj);
        assertTrue(obj.isInitialized());
        assertEquals(expected0, obj.value0);
        assertEquals(expected1, obj.value1);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.