|
||||||||||
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.TestStackObjectPool
public class TestStackObjectPool
Constructor Summary | |
---|---|
TestStackObjectPool(String testName)
|
Method Summary | |
---|---|
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 |
testBorrowFromEmptyPoolWithNullFactory()
Deprecated. - to be removed in pool 2.0 |
void |
testBorrowReturnWithSometimesInvalidObjects()
Verifies that validation and passivation failures returning objects are handled properly - instances destroyed and not returned to the pool, but no exceptions propagated. |
void |
testBorrowWithSometimesInvalidObjects()
Verifies that validation failures when borrowing newly created instances from the pool result in NoSuchElementExceptions and passivation failures result in instances not being returned to the pool. |
void |
testCanResetFactoryWithoutActiveObjects()
Deprecated. - to be removed in pool 2.0 |
void |
testCantResetFactoryWithActiveObjects()
Deprecated. - to be removed in pool 2.0 |
void |
testClose()
Verifies close contract - idle instances are destroyed, returning instances are destroyed, add/borrowObject throw IllegalStateException. |
void |
testExceptionOnActivate()
Verifies that exceptions thrown by factory activate method are not propagated to the caller. |
void |
testExceptionOnDestroy()
Verifies that exceptions thrown by factory destroy are swallowed by both addObject and returnObject. |
void |
testExceptionOnMake()
Verifies that exceptions thrown by makeObject are propagated. |
void |
testExceptionOnPassivate()
Verifies that addObject propagates exceptions thrown by factory passivate, but returnObject swallows these. |
void |
testExceptionOnValidate()
Verifies that validation exceptions always propagate |
void |
testIdleCap()
|
void |
testInitIdleCapacityExceeded()
Verifies that initIdleCapacity is not a hard limit, but maxIdle is. |
void |
testMakeNull()
Verifies NoSuchElementException when the factory returns a null object in borrowObject |
void |
testMaxIdleInitCapacityOutOfRange()
Verify that out of range constructor arguments are ignored. |
void |
testPoolWithNullFactory()
Deprecated. - to be removed in pool 2.0 |
void |
testReturnObjectDiscardOrder()
Verifies that when returning objects cause maxSleeping exceeded, oldest instances are destroyed to make room for returning objects. |
void |
testSetFactory()
Deprecated. - to be removed in pool 2.0 |
void |
testVariousConstructors()
|
Methods inherited from class org.apache.commons.pool.TestBaseObjectPool |
---|
testBaseAddObject, testBaseBorrow, testBaseBorrowReturn, testBaseClear, testBaseClosePool, testBaseInvalidateObject, testBaseNumActiveNumIdle, testUnsupportedOperations |
Methods inherited from class org.apache.commons.pool.TestObjectPool |
---|
testClosedPoolBehavior, testPOFAddObjectUsage, testPOFBorrowObjectUsages, testPOFClearUsages, testPOFCloseUsages, testPOFInvalidateObjectUsages, testPOFReturnObjectUsages, 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, setUp, tearDown, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestStackObjectPool(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 testIdleCap() throws Exception
Exception
public void testPoolWithNullFactory() throws Exception
Exception
public void testBorrowFromEmptyPoolWithNullFactory() throws Exception
Exception
public void testSetFactory() throws Exception
testSetFactory
in class TestObjectPool
Exception
public void testCantResetFactoryWithActiveObjects() throws Exception
Exception
public void testCanResetFactoryWithoutActiveObjects() throws Exception
Exception
public void testBorrowWithSometimesInvalidObjects() throws Exception
Exception
public void testBorrowReturnWithSometimesInvalidObjects() throws Exception
Exception
public void testVariousConstructors() throws Exception
Exception
public void testMaxIdleInitCapacityOutOfRange() throws Exception
Exception
public void testReturnObjectDiscardOrder() throws Exception
Exception
public void testExceptionOnActivate() throws Exception
Exception
public void testExceptionOnDestroy() throws Exception
Exception
public void testExceptionOnPassivate() throws Exception
Exception
public void testExceptionOnValidate() throws Exception
Exception
public void testExceptionOnMake() throws Exception
Exception
public void testMakeNull() throws Exception
Exception
public void testInitIdleCapacityExceeded() throws Exception
Exception
public void testClose() throws Exception
testClose
in class TestBaseObjectPool
Exception
protected boolean isLifo()
isLifo
in class TestBaseObjectPool
protected boolean isFifo()
isFifo
in class TestBaseObjectPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |