|
||||||||||
| 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<String>
org.apache.commons.pool.impl.TestStackObjectPool
public class TestStackObjectPool
| Constructor Summary | |
|---|---|
TestStackObjectPool(String testName)
|
|
| Method Summary | |
|---|---|
protected String |
getNthObject(int n)
|
protected boolean |
isFifo()
|
protected boolean |
isLifo()
|
protected ObjectPool<String> |
makeEmptyPool(int mincap)
|
protected ObjectPool<Integer> |
makeEmptyPool(PoolableObjectFactory<Integer> 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 |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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 |
| 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<String> makeEmptyPool(int mincap)
makeEmptyPool in class TestBaseObjectPool<String>protected ObjectPool<Integer> makeEmptyPool(PoolableObjectFactory<Integer> factory)
TestObjectPoolObjectPool 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<String>protected String getNthObject(int n)
getNthObject in class TestBaseObjectPool<String>
public void testIdleCap()
throws Exception
Exception
@Deprecated
public void testPoolWithNullFactory()
throws Exception
Exception
@Deprecated
public void testBorrowFromEmptyPoolWithNullFactory()
throws Exception
Exception
@Deprecated
public void testSetFactory()
throws Exception
testSetFactory in class TestObjectPoolException
@Deprecated
public void testCantResetFactoryWithActiveObjects()
throws Exception
Exception
@Deprecated
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<String>Exceptionprotected boolean isLifo()
isLifo in class TestBaseObjectPool<String>protected boolean isFifo()
isFifo in class TestBaseObjectPool<String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||