org.apache.commons.pool.impl
Class TestGenericKeyedObjectPool
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.commons.pool.TestKeyedObjectPool
org.apache.commons.pool.TestBaseKeyedObjectPool
org.apache.commons.pool.impl.TestGenericKeyedObjectPool
- All Implemented Interfaces:
- junit.framework.Test
public class TestGenericKeyedObjectPool
- extends TestBaseKeyedObjectPool
- Version:
- $Revision: 791860 $ $Date: 2009-07-07 11:10:30 -0400 (Tue, 07 Jul 2009) $
- Author:
- Rodney Waldhoff
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
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, fail, fail, failNotEquals, failNotSame, failSame, format |
TestGenericKeyedObjectPool
public TestGenericKeyedObjectPool(String testName)
suite
public static junit.framework.Test suite()
makeEmptyPool
protected org.apache.commons.pool.KeyedObjectPool makeEmptyPool(int mincapacity)
- Description copied from class:
TestBaseKeyedObjectPool
- Create an
KeyedObjectPool
instance
that can contain at least mincapacity
idle and active objects, or
throw IllegalArgumentException
if such a pool cannot be created.
- Overrides:
makeEmptyPool
in class TestBaseKeyedObjectPool
makeEmptyPool
protected org.apache.commons.pool.KeyedObjectPool makeEmptyPool(org.apache.commons.pool.KeyedPoolableObjectFactory factory)
- Description copied from class:
TestKeyedObjectPool
- Create an
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.
- Overrides:
makeEmptyPool
in class TestBaseKeyedObjectPool
getNthObject
protected Object getNthObject(Object key,
int n)
- Description copied from class:
TestBaseKeyedObjectPool
- Return what we expect to be the nth
object (zero indexed) created by the pool
for the given key.
- Overrides:
getNthObject
in class TestBaseKeyedObjectPool
makeKey
protected Object makeKey(int n)
- Overrides:
makeKey
in class TestBaseKeyedObjectPool
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class TestBaseKeyedObjectPool
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Overrides:
tearDown
in class TestBaseKeyedObjectPool
- Throws:
Exception
testNegativeMaxActive
public void testNegativeMaxActive()
throws Exception
- Throws:
Exception
testNumActiveNumIdle2
public void testNumActiveNumIdle2()
throws Exception
- Throws:
Exception
testMaxIdle
public void testMaxIdle()
throws Exception
- Throws:
Exception
testMaxActive
public void testMaxActive()
throws Exception
- Throws:
Exception
testMaxActiveZero
public void testMaxActiveZero()
throws Exception
- Throws:
Exception
testWhenExhaustedGrow
public void testWhenExhaustedGrow()
throws Exception
- Throws:
Exception
testMaxTotal
public void testMaxTotal()
throws Exception
- Throws:
Exception
testMaxTotalZero
public void testMaxTotalZero()
throws Exception
- Throws:
Exception
testMaxTotalLRU
public void testMaxTotalLRU()
throws Exception
- Throws:
Exception
testSettersAndGetters
public void testSettersAndGetters()
throws Exception
- Throws:
Exception
testEviction
public void testEviction()
throws Exception
- Throws:
Exception
testEviction2
public void testEviction2()
throws Exception
- Throws:
Exception
runTestThreads
public void runTestThreads(int numThreads,
int iterations,
int delay)
- Kicks off test threads, each of which will go through
borrow-return cycles with random delay times <= delay
in between.
testThreaded1
public void testThreaded1()
throws Exception
- Throws:
Exception
testMaxTotalInvariant
public void testMaxTotalInvariant()
throws Exception
- Verifies that maxTotal is not exceeded when factory destroyObject
has high latency, testOnReturn is set and there is high incidence of
validation failures.
- Throws:
Exception
testMinIdle
public void testMinIdle()
throws Exception
- Throws:
Exception
testMinIdleMaxActive
public void testMinIdleMaxActive()
throws Exception
- Throws:
Exception
testMinIdleNoPopulateImmediately
public void testMinIdleNoPopulateImmediately()
throws Exception
- Throws:
Exception
testMinIdleNoPreparePool
public void testMinIdleNoPreparePool()
throws Exception
- Throws:
Exception
testFIFO
public void testFIFO()
throws Exception
- Throws:
Exception
testLIFO
public void testLIFO()
throws Exception
- Throws:
Exception
testEvictionOrder
public void testEvictionOrder()
throws Exception
- Test to make sure evictor visits least recently used objects first,
regardless of FIFO/LIFO
JIRA: POOL-86
- Throws:
Exception
testEvictorVisiting
public void testEvictorVisiting()
throws Exception
- Verifies that the evictor visits objects in expected order
and frequency.
- Throws:
Exception
testConstructors
public void testConstructors()
testExceptionOnPassivateDuringReturn
public void testExceptionOnPassivateDuringReturn()
throws Exception
- Throws:
Exception
testExceptionOnDestroyDuringBorrow
public void testExceptionOnDestroyDuringBorrow()
throws Exception
- Throws:
Exception
testExceptionOnDestroyDuringReturn
public void testExceptionOnDestroyDuringReturn()
throws Exception
- Throws:
Exception
testExceptionOnActivateDuringBorrow
public void testExceptionOnActivateDuringBorrow()
throws Exception
- Throws:
Exception
testBlockedKeyDoesNotBlockPool
public void testBlockedKeyDoesNotBlockPool()
throws Exception
- Throws:
Exception
isLifo
protected boolean isLifo()
- Overrides:
isLifo
in class TestBaseKeyedObjectPool
isFifo
protected boolean isFifo()
- Overrides:
isFifo
in class TestBaseKeyedObjectPool
Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.