Keel 2.1RC2

org.apache.avalon.excalibur.pool.test
Class PoolComparisonProfileAbstract

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.avalon.excalibur.pool.test.PoolComparisonProfileAbstract
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
MultiThreadedPoolComparisonProfile, SingleThreadedPoolComparisonProfile

public abstract class PoolComparisonProfileAbstract
extends junit.framework.TestCase

Used as a basis for the PoolComparisonProfile Tests

Version:
$Id: PoolComparisonProfileAbstract.java,v 1.5 2004/03/29 16:50:37 mcconnell Exp $
Author:

Nested Class Summary
static class PoolComparisonProfileAbstract.LargePoolable
           
static class PoolComparisonProfileAbstract.MediumPoolable
           
static class PoolComparisonProfileAbstract.NoPoolingPool
          Dummy class used for timing test cases where no pooling is done.
static class PoolComparisonProfileAbstract.SmallPoolable
           
 
Field Summary
protected  Logger m_logger
           
protected  Logger m_poolLogger
           
protected static int TEST_SIZE
          The TEST_SIZE defines the overall size of the tests.
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
PoolComparisonProfileAbstract(java.lang.String name)
           
 
Method Summary
protected  void generalTest(java.lang.String name, Pool poolA, Pool poolB, int gets, ObjectFactory factory)
          The guts of the various test cases.
protected abstract  long getPoolRunTime(Pool pool, int gets)
           
protected  java.lang.String getShortClassName(java.lang.Object o)
           
protected  void resetMemory()
           
 void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
          Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
 void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
          Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
 void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
          Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_LargePoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_MediumPoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_SmallPoolables()
          Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEST_SIZE

protected static final int TEST_SIZE
The TEST_SIZE defines the overall size of the tests. Decreasing this will decrease the time the test takes to run, but also decrease its efficiency.

See Also:
Constant Field Values

m_logger

protected Logger m_logger

m_poolLogger

protected Logger m_poolLogger
Constructor Detail

PoolComparisonProfileAbstract

public PoolComparisonProfileAbstract(java.lang.String name)
Method Detail

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
                                                                                                 throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are small objects.

Throws:
java.lang.Exception

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_SmallPoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_SmallPoolables()
                                                                                                 throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 200 at a time, Poolables are small objects.

Throws:
java.lang.Exception

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables()
                                                                                                  throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are medium objects.

Throws:
java.lang.Exception

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_MediumPoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_MediumPoolables()
                                                                                                  throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 200 at a time, Poolables are medium objects.

Throws:
java.lang.Exception

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
                                                                                                 throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are large objects.

Throws:
java.lang.Exception

testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_LargePoolables

public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets200_LargePoolables()
                                                                                                 throws java.lang.Exception
Compare the SoftResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 200 at a time, Poolables are large objects.

Throws:
java.lang.Exception

testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables

public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
                                                                                                 throws java.lang.Exception
Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are small objects.

Throws:
java.lang.Exception

testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables

public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
                                                                                                throws java.lang.Exception
Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are medium objects.

Throws:
java.lang.Exception

testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables

public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
                                                                                                 throws java.lang.Exception
Compare the HardResourceLimitingPool and ResourceLimitingPool when the ResourceLimitingPool is configured to act like a HardResourceLimitingPool.

Test will use pools with a max size of 100, while getting up to 100 at a time, Poolables are large objects.

Throws:
java.lang.Exception

resetMemory

protected void resetMemory()

getShortClassName

protected java.lang.String getShortClassName(java.lang.Object o)

getPoolRunTime

protected abstract long getPoolRunTime(Pool pool,
                                       int gets)
                                throws java.lang.Exception
Throws:
java.lang.Exception

generalTest

protected void generalTest(java.lang.String name,
                           Pool poolA,
                           Pool poolB,
                           int gets,
                           ObjectFactory factory)
                    throws java.lang.Exception
The guts of the various test cases. Will dispose the pools

Throws:
java.lang.Exception

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.