|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.commons.pool.TestKeyedObjectPool
org.apache.commons.pool.TestBaseKeyedObjectPool
org.apache.commons.pool.impl.TestGenericKeyedObjectPool
public class TestGenericKeyedObjectPool
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.commons.pool.TestKeyedObjectPool |
---|
TestKeyedObjectPool.FailingKeyedPoolableObjectFactory |
Field Summary |
---|
Fields inherited from class org.apache.commons.pool.TestKeyedObjectPool |
---|
KEY |
Constructor Summary | |
---|---|
TestGenericKeyedObjectPool(String testName)
|
Method Summary | |
---|---|
protected Object |
getNthObject(Object key,
int n)
Return what we expect to be the nth object (zero indexed) created by the pool for the given key. |
protected boolean |
isFifo()
|
protected boolean |
isLifo()
|
protected KeyedObjectPool |
makeEmptyPool(int mincapacity)
Create an KeyedObjectPool instance
that can contain at least mincapacity
idle and active objects, or
throw IllegalArgumentException
if such a pool cannot be created. |
protected KeyedObjectPool |
makeEmptyPool(KeyedPoolableObjectFactory factory)
Create an KeyedObjectPool with the specified factory. |
protected Object |
makeKey(int n)
|
void |
runTestThreads(int numThreads,
int iterations,
int delay)
Kicks off |
void |
setUp()
|
void |
tearDown()
|
void |
testBlockedKeyDoesNotBlockPool()
|
void |
testClear()
POOL-192 Verify that clear(key) does not leak capacity due to _numInternalProcessing not being decremented. |
void |
testConstructors()
|
void |
testEviction()
|
void |
testEviction2()
|
void |
testEvictionOrder()
Test to make sure evictor visits least recently used objects first, regardless of FIFO/LIFO JIRA: POOL-86 |
void |
testEvictorVisiting()
Verifies that the evictor visits objects in expected order and frequency. |
void |
testExceptionOnActivateDuringBorrow()
|
void |
testExceptionOnDestroyDuringBorrow()
|
void |
testExceptionOnDestroyDuringReturn()
|
void |
testExceptionOnPassivateDuringReturn()
|
void |
testFIFO()
|
void |
testLIFO()
|
void |
testMaxActive()
|
void |
testMaxActivePerKeyExceeded()
Test case for POOL-180. |
void |
testMaxActiveZero()
|
void |
testMaxIdle()
|
void |
testMaxTotal()
|
void |
testMaxTotalInvariant()
Verifies that maxTotal is not exceeded when factory destroyObject has high latency, testOnReturn is set and there is high incidence of validation failures. |
void |
testMaxTotalLRU()
|
void |
testMaxTotalZero()
|
void |
testMaxWaitMultiThreaded()
|
void |
testMinIdle()
|
void |
testMinIdleMaxActive()
|
void |
testMinIdleNoPopulateImmediately()
|
void |
testMinIdleNoPreparePool()
|
void |
testNegativeMaxActive()
|
void |
testNumActiveNumIdle2()
|
void |
testSettersAndGetters()
|
void |
testThreaded1()
|
void |
testWhenExhaustedBlockClosePool()
|
void |
testWhenExhaustedGrow()
|
Methods inherited from class org.apache.commons.pool.TestBaseKeyedObjectPool |
---|
testBaseAddObject, testBaseBorrow, testBaseBorrowReturn, testBaseClear, testBaseInvalidateObject, testBaseNumActiveNumIdle, testBaseNumActiveNumIdle2, testUnsupportedOperations |
Methods inherited from class org.apache.commons.pool.TestKeyedObjectPool |
---|
testClosedPoolBehavior, testKPOFAddObjectUsage, testKPOFBorrowObjectUsages, testKPOFClearUsages, testKPOFCloseUsages, testKPOFInvalidateObjectUsages, testKPOFReturnObjectUsages, testToString |
Methods inherited from class junit.framework.TestCase |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestGenericKeyedObjectPool(String testName)
Method Detail |
---|
protected KeyedObjectPool makeEmptyPool(int mincapacity)
TestBaseKeyedObjectPool
KeyedObjectPool
instance
that can contain at least mincapacity
idle and active objects, or
throw IllegalArgumentException
if such a pool cannot be created.
makeEmptyPool
in class TestBaseKeyedObjectPool
protected KeyedObjectPool makeEmptyPool(KeyedPoolableObjectFactory factory)
TestKeyedObjectPool
KeyedObjectPool
with the specified factory.
The pool should be in a default configuration and conform to the expected
behaviors described in KeyedObjectPool
.
Generally speaking there should be no limits on the various object counts.
makeEmptyPool
in class TestBaseKeyedObjectPool
protected Object getNthObject(Object key, int n)
TestBaseKeyedObjectPool
getNthObject
in class TestBaseKeyedObjectPool
protected Object makeKey(int n)
makeKey
in class TestBaseKeyedObjectPool
public void setUp() throws Exception
setUp
in class TestBaseKeyedObjectPool
Exception
public void tearDown() throws Exception
tearDown
in class TestBaseKeyedObjectPool
Exception
public void testNegativeMaxActive() throws Exception
Exception
public void testNumActiveNumIdle2() throws Exception
Exception
public void testMaxIdle() throws Exception
Exception
public void testMaxActive() throws Exception
Exception
public void testMaxActiveZero() throws Exception
Exception
public void testWhenExhaustedGrow() throws Exception
Exception
public void testWhenExhaustedBlockClosePool() throws Exception
Exception
public void testMaxTotal() throws Exception
Exception
public void testMaxTotalZero() throws Exception
Exception
public void testMaxTotalLRU() throws Exception
Exception
public void testSettersAndGetters() throws Exception
Exception
public void testEviction() throws Exception
Exception
public void testEviction2() throws Exception
Exception
public void runTestThreads(int numThreads, int iterations, int delay)
public void testThreaded1() throws Exception
Exception
public void testMaxTotalInvariant() throws Exception
Exception
public void testMinIdle() throws Exception
Exception
public void testMinIdleMaxActive() throws Exception
Exception
public void testMinIdleNoPopulateImmediately() throws Exception
Exception
public void testMinIdleNoPreparePool() throws Exception
Exception
public void testFIFO() throws Exception
Exception
public void testLIFO() throws Exception
Exception
public void testEvictionOrder() throws Exception
Exception
public void testEvictorVisiting() throws Exception
Exception
public void testConstructors()
public void testExceptionOnPassivateDuringReturn() throws Exception
Exception
public void testExceptionOnDestroyDuringBorrow() throws Exception
Exception
public void testExceptionOnDestroyDuringReturn() throws Exception
Exception
public void testExceptionOnActivateDuringBorrow() throws Exception
Exception
public void testBlockedKeyDoesNotBlockPool() throws Exception
Exception
public void testMaxWaitMultiThreaded() throws Exception
Exception
public void testMaxActivePerKeyExceeded()
public void testClear() throws Exception
Exception
protected boolean isLifo()
isLifo
in class TestBaseKeyedObjectPool
protected boolean isFifo()
isFifo
in class TestBaseKeyedObjectPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |