org.apache.commons.pool.impl
Class TestStackObjectPool

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.pool.TestObjectPool
              extended by org.apache.commons.pool.TestBaseObjectPool
                  extended by org.apache.commons.pool.impl.TestStackObjectPool
All Implemented Interfaces:
junit.framework.Test

public class TestStackObjectPool
extends TestBaseObjectPool

Version:
$Revision: 775703 $ $Date: 2009-05-17 12:39:51 -0400 (Sun, 17 May 2009) $
Author:
Rodney Waldhoff, Dirk Verbeeck, Sandy McArthur

Constructor Summary
TestStackObjectPool(String testName)
           
 
Method Summary
protected  Object getNthObject(int n)
           
protected  boolean isFifo()
           
protected  boolean isLifo()
           
protected  org.apache.commons.pool.ObjectPool makeEmptyPool(int mincap)
           
protected  org.apache.commons.pool.ObjectPool makeEmptyPool(org.apache.commons.pool.PoolableObjectFactory factory)
          Create an ObjectPool with the specified factory.
static junit.framework.Test suite()
           
 void testBorrowFromEmptyPoolWithNullFactory()
           
 void testBorrowReturnWithSometimesInvalidObjects()
           
 void testBorrowWithSometimesInvalidObjects()
           
 void testCanResetFactoryWithoutActiveObjects()
           
 void testCantResetFactoryWithActiveObjects()
           
 void testIdleCap()
           
 void testPoolWithNullFactory()
           
 void testReturnObjectDiscardOrder()
           
 void testSetFactory()
           
 void testVariousConstructors()
           
 
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, 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

TestStackObjectPool

public TestStackObjectPool(String testName)
Method Detail

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

testIdleCap

public void testIdleCap()
                 throws Exception
Throws:
Exception

testPoolWithNullFactory

public void testPoolWithNullFactory()
                             throws Exception
Throws:
Exception

testBorrowFromEmptyPoolWithNullFactory

public void testBorrowFromEmptyPoolWithNullFactory()
                                            throws Exception
Throws:
Exception

testSetFactory

public void testSetFactory()
                    throws Exception
Overrides:
testSetFactory in class TestObjectPool
Throws:
Exception

testCantResetFactoryWithActiveObjects

public void testCantResetFactoryWithActiveObjects()
                                           throws Exception
Throws:
Exception

testCanResetFactoryWithoutActiveObjects

public void testCanResetFactoryWithoutActiveObjects()
                                             throws Exception
Throws:
Exception

testBorrowWithSometimesInvalidObjects

public void testBorrowWithSometimesInvalidObjects()
                                           throws Exception
Throws:
Exception

testBorrowReturnWithSometimesInvalidObjects

public void testBorrowReturnWithSometimesInvalidObjects()
                                                 throws Exception
Throws:
Exception

testVariousConstructors

public void testVariousConstructors()
                             throws Exception
Throws:
Exception

testReturnObjectDiscardOrder

public void testReturnObjectDiscardOrder()
                                  throws Exception
Throws:
Exception

isLifo

protected boolean isLifo()
Overrides:
isLifo in class TestBaseObjectPool

isFifo

protected boolean isFifo()
Overrides:
isFifo in class TestBaseObjectPool


Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.