org.apache.commons.pool.impl
Class TestGenericObjectPool
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.commons.pool.TestObjectPool
org.apache.commons.pool.TestBaseObjectPool
org.apache.commons.pool.impl.TestGenericObjectPool
- All Implemented Interfaces:
- junit.framework.Test
public class TestGenericObjectPool
- extends TestBaseObjectPool
- Version:
- $Revision: 791860 $ $Date: 2009-07-07 11:10:30 -0400 (Tue, 07 Jul 2009) $
- Author:
- Rodney Waldhoff, Dirk Verbeeck, Sandy McArthur
Field Summary |
protected org.apache.commons.pool.impl.GenericObjectPool |
pool
|
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 |
pool
protected org.apache.commons.pool.impl.GenericObjectPool pool
TestGenericObjectPool
public TestGenericObjectPool(String testName)
suite
public static junit.framework.Test suite()
makeEmptyPool
protected org.apache.commons.pool.ObjectPool makeEmptyPool(int mincap)
- Overrides:
makeEmptyPool
in class TestBaseObjectPool
makeEmptyPool
protected org.apache.commons.pool.ObjectPool makeEmptyPool(org.apache.commons.pool.PoolableObjectFactory factory)
- Description copied from class:
TestObjectPool
- Create an
ObjectPool
with the specified factory.
The pool should be in a default configuration and conform to the expected
behaviors described in ObjectPool
.
Generally speaking there should be no limits on the various object counts.
- Overrides:
makeEmptyPool
in class TestBaseObjectPool
getNthObject
protected Object getNthObject(int n)
- Overrides:
getNthObject
in class TestBaseObjectPool
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class junit.framework.TestCase
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Overrides:
tearDown
in class junit.framework.TestCase
- Throws:
Exception
testWhenExhaustedGrow
public void testWhenExhaustedGrow()
throws Exception
- Throws:
Exception
testWhenExhaustedFail
public void testWhenExhaustedFail()
throws Exception
- Throws:
Exception
testWhenExhaustedBlock
public void testWhenExhaustedBlock()
throws Exception
- Throws:
Exception
testEvictWhileEmpty
public void testEvictWhileEmpty()
throws Exception
- Throws:
Exception
testEvictAddObjects
public void testEvictAddObjects()
throws Exception
- Tests addObject contention between ensureMinIdle triggered by
the Evictor with minIdle > 0 and borrowObject.
- Throws:
Exception
testEvictLIFO
public void testEvictLIFO()
throws Exception
- Throws:
Exception
testEvictFIFO
public void testEvictFIFO()
throws Exception
- Throws:
Exception
checkEvict
public void checkEvict(boolean lifo)
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
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
testSetFactoryWithActiveObjects
public void testSetFactoryWithActiveObjects()
throws Exception
- Throws:
Exception
testSetFactoryWithNoActiveObjects
public void testSetFactoryWithNoActiveObjects()
throws Exception
- Throws:
Exception
testNegativeMaxActive
public void testNegativeMaxActive()
throws Exception
- Throws:
Exception
testMaxIdle
public void testMaxIdle()
throws Exception
- Throws:
Exception
testMaxIdleZero
public void testMaxIdleZero()
throws Exception
- Throws:
Exception
testMaxActive
public void testMaxActive()
throws Exception
- Throws:
Exception
testTimeoutNoLeak
public void testTimeoutNoLeak()
throws Exception
- Throws:
Exception
testMaxActiveZero
public void testMaxActiveZero()
throws Exception
- Throws:
Exception
testMaxActiveUnderLoad
public void testMaxActiveUnderLoad()
testInvalidWhenExhaustedAction
public void testInvalidWhenExhaustedAction()
throws Exception
- Throws:
Exception
testSettersAndGetters
public void testSettersAndGetters()
throws Exception
- Throws:
Exception
testDefaultConfiguration
public void testDefaultConfiguration()
throws Exception
- Throws:
Exception
testConstructors
public void testConstructors()
throws Exception
- Throws:
Exception
testSetConfig
public void testSetConfig()
throws Exception
- Throws:
Exception
testDebugInfo
public void testDebugInfo()
throws Exception
- Throws:
Exception
testStartAndStopEvictor
public void testStartAndStopEvictor()
throws Exception
- Throws:
Exception
testEvictionWithNegativeNumTests
public void testEvictionWithNegativeNumTests()
throws Exception
- Throws:
Exception
testEviction
public void testEviction()
throws Exception
- Throws:
Exception
testEvictionSoftMinIdle
public void testEvictionSoftMinIdle()
throws Exception
- Throws:
Exception
testMinIdle
public void testMinIdle()
throws Exception
- Throws:
Exception
testMinIdleMaxActive
public void testMinIdleMaxActive()
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
testMaxActiveInvariant
public void testMaxActiveInvariant()
throws Exception
- Verifies that maxActive is not exceeded when factory destroyObject
has high latency, testOnReturn is set and there is high incidence of
validation failures.
- Throws:
Exception
testFIFO
public void testFIFO()
throws Exception
- Throws:
Exception
testLIFO
public void testLIFO()
throws Exception
- Throws:
Exception
testAddObject
public void testAddObject()
throws Exception
- Throws:
Exception
isLifo
protected boolean isLifo()
- Overrides:
isLifo
in class TestBaseObjectPool
isFifo
protected boolean isFifo()
- Overrides:
isFifo
in class TestBaseObjectPool
testBorrowObjectFairness
public void testBorrowObjectFairness()
Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.