|
||||||||||
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.TestObjectPool
org.apache.commons.pool.TestBaseObjectPool
org.apache.commons.pool.impl.TestGenericObjectPool
public class TestGenericObjectPool
Nested Class Summary | |
---|---|
class |
TestGenericObjectPool.SimpleFactory
|
Field Summary | |
---|---|
protected GenericObjectPool |
pool
|
Constructor Summary | |
---|---|
TestGenericObjectPool(String testName)
|
Method Summary | |
---|---|
void |
checkEvict(boolean lifo)
|
protected Object |
getNthObject(int n)
|
protected boolean |
isFifo()
|
protected boolean |
isLifo()
|
protected ObjectPool |
makeEmptyPool(int mincap)
|
protected ObjectPool |
makeEmptyPool(PoolableObjectFactory factory)
Create an ObjectPool with the specified factory. |
void |
runTestThreads(int numThreads,
int iterations,
int delay)
Kicks off |
void |
setUp()
|
void |
tearDown()
|
void |
testAddObject()
|
void |
testBorrowObjectFairness()
|
void |
testBrokenFactoryShouldNotBlockPool()
On first borrow, first object fails validation, second object is OK. |
void |
testConcurrentBorrowAndEvict()
|
void |
testConstructors()
|
void |
testDebugInfo()
|
void |
testDefaultConfiguration()
|
void |
testEvictAddObjects()
Tests addObject contention between ensureMinIdle triggered by the Evictor with minIdle > 0 and borrowObject. |
void |
testEvictFIFO()
|
void |
testEviction()
|
void |
testEvictionOrder()
Test to make sure evictor visits least recently used objects first, regardless of FIFO/LIFO JIRA: POOL-86 |
void |
testEvictionSoftMinIdle()
|
void |
testEvictionWithNegativeNumTests()
|
void |
testEvictLIFO()
|
void |
testEvictorVisiting()
Verifies that the evictor visits objects in expected order and frequency. |
void |
testEvictWhileEmpty()
|
void |
testExceptionOnActivateDuringBorrow()
|
void |
testExceptionOnDestroyDuringBorrow()
|
void |
testExceptionOnDestroyDuringReturn()
|
void |
testExceptionOnPassivateDuringReturn()
|
void |
testFIFO()
|
void |
testInvalidWhenExhaustedAction()
|
void |
testLIFO()
|
void |
testMakeConcurrentWithReturn()
Test the following scenario: Thread 1 borrows an instance Thread 2 starts to borrow another instance before thread 1 returns its instance Thread 1 returns its instance while thread 2 is validating its newly created instance The test verifies that the instance created by Thread 2 is not leaked. |
void |
testMaxActive()
|
void |
testMaxActiveInvariant()
Verifies that maxActive is not exceeded when factory destroyObject has high latency, testOnReturn is set and there is high incidence of validation failures. |
void |
testMaxActiveUnderLoad()
|
void |
testMaxActiveZero()
|
void |
testMaxIdle()
|
void |
testMaxIdleZero()
|
void |
testMaxWaitMultiThreaded()
|
void |
testMinIdle()
|
void |
testMinIdleMaxActive()
|
void |
testNegativeMaxActive()
|
void |
testSetConfig()
|
void |
testSetFactoryWithActiveObjects()
|
void |
testSetFactoryWithNoActiveObjects()
|
void |
testSettersAndGetters()
|
void |
testStartAndStopEvictor()
|
void |
testThreaded1()
|
void |
testTimeoutNoLeak()
|
void |
testWhenExhaustedBlock()
|
void |
testWhenExhaustedBlockClosePool()
|
void |
testWhenExhaustedBlockInterupt()
|
void |
testWhenExhaustedFail()
|
void |
testWhenExhaustedGrow()
|
Methods inherited from class org.apache.commons.pool.TestBaseObjectPool |
---|
testBaseAddObject, testBaseBorrow, testBaseBorrowReturn, testBaseClear, testBaseClosePool, testBaseInvalidateObject, testBaseNumActiveNumIdle, testClose, testUnsupportedOperations |
Methods inherited from class org.apache.commons.pool.TestObjectPool |
---|
testClosedPoolBehavior, testPOFAddObjectUsage, testPOFBorrowObjectUsages, testPOFClearUsages, testPOFCloseUsages, testPOFInvalidateObjectUsages, testPOFReturnObjectUsages, testSetFactory, 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 |
Field Detail |
---|
protected GenericObjectPool pool
Constructor Detail |
---|
public TestGenericObjectPool(String testName)
Method Detail |
---|
protected ObjectPool makeEmptyPool(int mincap)
makeEmptyPool
in class TestBaseObjectPool
protected ObjectPool makeEmptyPool(PoolableObjectFactory factory)
TestObjectPool
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.
makeEmptyPool
in class TestBaseObjectPool
protected Object getNthObject(int n)
getNthObject
in class TestBaseObjectPool
public void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public void testWhenExhaustedGrow() throws Exception
Exception
public void testWhenExhaustedFail() throws Exception
Exception
public void testWhenExhaustedBlock() throws Exception
Exception
public void testWhenExhaustedBlockInterupt() throws Exception
Exception
public void testWhenExhaustedBlockClosePool() throws Exception
Exception
public void testEvictWhileEmpty() throws Exception
Exception
public void testEvictAddObjects() throws Exception
Exception
public void testEvictLIFO() throws Exception
Exception
public void testEvictFIFO() throws Exception
Exception
public void checkEvict(boolean lifo) throws Exception
Exception
public void testEvictionOrder() throws Exception
Exception
public void testEvictorVisiting() throws Exception
Exception
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 testSetFactoryWithActiveObjects() throws Exception
Exception
public void testSetFactoryWithNoActiveObjects() throws Exception
Exception
public void testNegativeMaxActive() throws Exception
Exception
public void testMaxIdle() throws Exception
Exception
public void testMaxIdleZero() throws Exception
Exception
public void testMaxActive() throws Exception
Exception
public void testTimeoutNoLeak() throws Exception
Exception
public void testMaxActiveZero() throws Exception
Exception
public void testMaxActiveUnderLoad()
public void testInvalidWhenExhaustedAction() throws Exception
Exception
public void testSettersAndGetters() throws Exception
Exception
public void testDefaultConfiguration() throws Exception
Exception
public void testConstructors() throws Exception
Exception
public void testSetConfig() throws Exception
Exception
public void testDebugInfo() throws Exception
Exception
public void testStartAndStopEvictor() throws Exception
Exception
public void testEvictionWithNegativeNumTests() throws Exception
Exception
public void testEviction() throws Exception
Exception
public void testEvictionSoftMinIdle() throws Exception
Exception
public void testMinIdle() throws Exception
Exception
public void testMinIdleMaxActive() throws Exception
Exception
public void runTestThreads(int numThreads, int iterations, int delay)
public void testThreaded1() throws Exception
Exception
public void testMaxActiveInvariant() throws Exception
Exception
public void testConcurrentBorrowAndEvict() throws Exception
Exception
public void testFIFO() throws Exception
Exception
public void testLIFO() throws Exception
Exception
public void testAddObject() throws Exception
Exception
protected boolean isLifo()
isLifo
in class TestBaseObjectPool
protected boolean isFifo()
isFifo
in class TestBaseObjectPool
public void testBorrowObjectFairness()
public void testBrokenFactoryShouldNotBlockPool()
public void testMaxWaitMultiThreaded() throws Exception
Exception
public void testMakeConcurrentWithReturn() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |