org.apache.commons.pool
Class TestBaseKeyedObjectPool

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.pool.TestKeyedObjectPool
              extended by org.apache.commons.pool.TestBaseKeyedObjectPool
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestGenericKeyedObjectPool, TestStackKeyedObjectPool

public class TestBaseKeyedObjectPool
extends TestKeyedObjectPool

Version:
$Revision: 606064 $ $Date: 2007-12-20 19:12:02 -0500 (Thu, 20 Dec 2007) $
Author:
Rodney Waldhoff, Sandy McArthur

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.pool.TestKeyedObjectPool
TestKeyedObjectPool.FailingKeyedPoolableObjectFactory
 
Field Summary
 
Fields inherited from class org.apache.commons.pool.TestKeyedObjectPool
KEY
 
Constructor Summary
TestBaseKeyedObjectPool(String testName)
           
 
Method Summary
protected  Object getNthObject(Object key, int n)
          Return what we expect to be the nth object (zero indexed) created by the pool for the given key.
protected  boolean isFifo()
           
protected  boolean isLifo()
           
protected  org.apache.commons.pool.KeyedObjectPool makeEmptyPool(int mincapacity)
          Create an KeyedObjectPool instance that can contain at least mincapacity idle and active objects, or throw IllegalArgumentException if such a pool cannot be created.
protected  org.apache.commons.pool.KeyedObjectPool makeEmptyPool(org.apache.commons.pool.KeyedPoolableObjectFactory factory)
          Create an KeyedObjectPool with the specified factory.
protected  Object makeKey(int n)
           
 void setUp()
           
static junit.framework.Test suite()
           
 void tearDown()
           
 void testBaseAddObject()
           
 void testBaseBorrow()
           
 void testBaseBorrowReturn()
           
 void testBaseClear()
           
 void testBaseInvalidateObject()
           
 void testBaseNumActiveNumIdle()
           
 void testBaseNumActiveNumIdle2()
           
 void testUnsupportedOperations()
           
 
Methods inherited from class org.apache.commons.pool.TestKeyedObjectPool
testClosedPoolBehavior, testKPOFAddObjectUsage, testKPOFBorrowObjectUsages, testKPOFClearUsages, testKPOFCloseUsages, testKPOFInvalidateObjectUsages, testKPOFReturnObjectUsages, testToString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestBaseKeyedObjectPool

public TestBaseKeyedObjectPool(String testName)
Method Detail

makeEmptyPool

protected org.apache.commons.pool.KeyedObjectPool makeEmptyPool(org.apache.commons.pool.KeyedPoolableObjectFactory factory)
Description copied from class: TestKeyedObjectPool
Create an KeyedObjectPool with the specified factory. The pool should be in a default configuration and conform to the expected behaviors described in KeyedObjectPool. Generally speaking there should be no limits on the various object counts.

Specified by:
makeEmptyPool in class TestKeyedObjectPool

makeEmptyPool

protected org.apache.commons.pool.KeyedObjectPool makeEmptyPool(int mincapacity)
Create an KeyedObjectPool instance that can contain at least mincapacity idle and active objects, or throw IllegalArgumentException if such a pool cannot be created.


getNthObject

protected Object getNthObject(Object key,
                              int n)
Return what we expect to be the nth object (zero indexed) created by the pool for the given key.


makeKey

protected Object makeKey(int n)

suite

public static junit.framework.Test suite()

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

testUnsupportedOperations

public void testUnsupportedOperations()
                               throws Exception
Throws:
Exception

isLifo

protected boolean isLifo()

isFifo

protected boolean isFifo()

testBaseBorrowReturn

public void testBaseBorrowReturn()
                          throws Exception
Throws:
Exception

testBaseBorrow

public void testBaseBorrow()
                    throws Exception
Throws:
Exception

testBaseNumActiveNumIdle

public void testBaseNumActiveNumIdle()
                              throws Exception
Throws:
Exception

testBaseNumActiveNumIdle2

public void testBaseNumActiveNumIdle2()
                               throws Exception
Throws:
Exception

testBaseClear

public void testBaseClear()
                   throws Exception
Throws:
Exception

testBaseInvalidateObject

public void testBaseInvalidateObject()
                              throws Exception
Throws:
Exception

testBaseAddObject

public void testBaseAddObject()
                       throws Exception
Throws:
Exception


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