avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test MultiThreadedPoolComparisonProfile.java PoolComparisonProfileAbstract.java SingleThreadedPoolComparisonProfile.java PoolableTestObject.java ResourceLimitingPoolMultithreadMaxStrictBlockTestCase.java ResourceLimitingPoolMultithreadMaxStrictTestCase.java ResourceLimitingPoolMultithreadMaxTestCase.java ResourceLimitingPoolMultithreadTestCase.java ResourceLimitingPoolTestCase.java
Date Wed, 13 Feb 2002 16:19:53 GMT
bloritsch    02/02/13 08:19:53

  Modified:    src/scratchpad/org/apache/avalon/excalibur/mpool
                        VariableSizePool.java
               src/scratchpad/org/apache/avalon/excalibur/mpool/test
                        MultiThreadedPoolComparisonProfile.java
                        PoolComparisonProfileAbstract.java
                        SingleThreadedPoolComparisonProfile.java
  Added:       src/scratchpad/org/apache/avalon/excalibur/mpool
                        ObjectFactory.java Pool.java
  Removed:     src/scratchpad/org/apache/avalon/excalibur/mpool/test
                        PoolableTestObject.java
                        ResourceLimitingPoolMultithreadMaxStrictBlockTestCase.java
                        ResourceLimitingPoolMultithreadMaxStrictTestCase.java
                        ResourceLimitingPoolMultithreadMaxTestCase.java
                        ResourceLimitingPoolMultithreadTestCase.java
                        ResourceLimitingPoolTestCase.java
  Log:
  update mpool testing to be mpool specific, and upped the number of threads to show how they scale to massive parallelism
  
  Revision  Changes    Path
  1.2       +11 -3     jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/VariableSizePool.java
  
  Index: VariableSizePool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/VariableSizePool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VariableSizePool.java	12 Feb 2002 21:30:42 -0000	1.1
  +++ VariableSizePool.java	13 Feb 2002 16:19:53 -0000	1.2
  @@ -10,6 +10,7 @@
   
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.excalibur.collections.Buffer;
  +import org.apache.avalon.excalibur.collections.BufferUnderflowException;
   import org.apache.avalon.excalibur.collections.VariableSizeBuffer;
   
   /**
  @@ -17,7 +18,7 @@
    * Please note that this pool offers no resource limiting whatsoever.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/02/12 21:30:42 $
  + * @version CVS $Revision: 1.2 $ $Date: 2002/02/13 16:19:53 $
    * @since 4.1
    */
   public final class VariableSizePool
  @@ -63,9 +64,16 @@
   
           Object object = null;
   
  -        synchronized ( m_buffer )
  +        try
           {
  -            object = m_buffer.remove();
  +            synchronized ( m_buffer )
  +            {
  +                object = m_buffer.remove();
  +            }
  +        }
  +        catch( BufferUnderflowException bue )
  +        {
  +            object = newInstance();
           }
   
           if ( null == object )
  
  
  
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/ObjectFactory.java
  
  Index: ObjectFactory.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.mpool;
  
  /**
   * This interface is to define how an ObjectFactory is defined.  While this
   * class is not strictly necessary, the implementation of the Pool can differ
   * object creation to and instance of this interface.
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/02/13 16:19:53 $
   * @since 4.1.2
   */
  public interface ObjectFactory
  {
      /**
       * Create a new instance of the object being pooled.
       *
       * @return the pooled Object instance
       * @throws Exception if the object cannot be instantiated
       */
      Object newInstance() throws Exception;
  
      /**
       * Get the class of the object you are creating.
       *
       * @return Class object of the factory's class
       */
      Class getCreatedClass();
  
      /**
       * Performs any deconstruction that is necessary for the
       * object.
       *
       * @param object to destroy
       * @throws IllegalArgumentException if the object is not of
       *         the same class that the factory creates.
       * @throws Exception if there is any other reason that the
       *         factory has problems disposing of the object.
       */
      void dispose(Object object) throws Exception;
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/Pool.java
  
  Index: Pool.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.mpool;
  
  /**
   * This interface is to define how a Pool is used.  We have determined by
   * using the previous Pool implementations that the Pool marker interface
   * is considered harmful.  When generics are introduced in JDK 1.5, this
   * interface will be a prime candidate for those improvements.
   *
   * <p>
   *  It is important to realize that some objects are cheaper to simply allow
   *  the garbage collector to take care of them.  Therefore, only pool objects
   *  that are computationally expensive to create.  Prime candidates would be
   *  Components, JDBC Connection objects, Socket connections, etc.
   * </p>
   * <p>
   *  The interface is inspired by both the Mutex acquire/release and the
   *  structure of the ThreadLocal object.  In fact, it would be trivial
   *  to implement a "ThreadLocal" pool.
   * </p>
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/02/13 16:19:53 $
   * @since 4.1.2
   */
  public interface Pool
  {
      /**
       * Acquire an instance of the pooled object.
       *
       * @return the pooled Object instance
       */
      Object acquire() throws Exception;
  
      /**
       * Release the instance of the pooled object.
       *
       * @param pooledObject  The pooled object to release to the pool.
       */
      void release( Object pooledObject );
  
      /**
       * Create a new instance of the object being pooled.
       *
       * @return the pooled Object instance
       */
      Object newInstance() throws Exception;
  }
  
  
  
  1.3       +9 -6      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/MultiThreadedPoolComparisonProfile.java
  
  Index: MultiThreadedPoolComparisonProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/MultiThreadedPoolComparisonProfile.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MultiThreadedPoolComparisonProfile.java	12 Feb 2002 22:21:15 -0000	1.2
  +++ MultiThreadedPoolComparisonProfile.java	13 Feb 2002 16:19:53 -0000	1.3
  @@ -31,12 +31,12 @@
    *  given a single access thread.
    *
    * @author <a href="mailto:leif@silveregg.co.jp">Leif Mortenson</a>
  - * @version $Id: MultiThreadedPoolComparisonProfile.java,v 1.2 2002/02/12 22:21:15 bloritsch Exp $
  + * @version $Id: MultiThreadedPoolComparisonProfile.java,v 1.3 2002/02/13 16:19:53 bloritsch Exp $
    */
   public class MultiThreadedPoolComparisonProfile
       extends PoolComparisonProfileAbstract
   {
  -    protected static final int THREADS = 10;
  +    protected static final int THREADS = 100;
   
       private int       m_startedCount;
       private boolean   m_latched;
  @@ -60,6 +60,7 @@
       {
           if ( gets % THREADS != 0 )
           {
  +            m_logger.info("Invalid: " + gets % THREADS + " gets(" + gets + ") threads(" + THREADS + ")" );
               fail( "gets must be evenly divisible by THREADS");
           }
   
  @@ -109,6 +110,7 @@
       {
           if ( gets % THREADS != 0 )
           {
  +            m_logger.info("Invalid: " + gets % THREADS + " gets(" + gets + ") threads(" + THREADS + ")" );
               fail( "gets must be evenly divisible by THREADS");
           }
   
  @@ -180,7 +182,7 @@
               // Perform this threads part of the test.
               final int cnt = m_gets / THREADS;
               final Poolable[] poolTmp = new Poolable[cnt];
  -            final int loops = TEST_SIZE / m_gets;
  +            final int loops = (TEST_SIZE / THREADS) / cnt;
               for( int i = 0; i < loops; i++ )
               {
                   // Get some Poolables
  @@ -223,7 +225,7 @@
           private Pool m_pool;
           private int m_getCount = 0;
           private Throwable m_throwable = null;
  -        private int m_gets;
  +        private final int m_gets;
   
           public MPoolRunner(Pool pool, int gets, Logger logger)
           {
  @@ -247,7 +249,7 @@
               // Perform this threads part of the test.
               final int cnt = m_gets / THREADS;
               final Object[] poolTmp = new Poolable[cnt];
  -            final int loops = TEST_SIZE / m_gets;
  +            final int loops = (TEST_SIZE / THREADS) / cnt;
               for( int i = 0; i < loops; i++ )
               {
                   // Get some Poolables
  @@ -260,7 +262,8 @@
                       }
                       catch ( Throwable t )
                       {
  -                        m_logger.error( "Unexpected error", t );
  +                        m_logger.error( "Unexpected error after " + m_getCount +
  +                                        " items retrieved and " + m_gets + " requested", t );
   
                           if (m_throwable == null) {
                               m_throwable = t;
  
  
  
  1.3       +156 -331  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/PoolComparisonProfileAbstract.java
  
  Index: PoolComparisonProfileAbstract.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/PoolComparisonProfileAbstract.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PoolComparisonProfileAbstract.java	12 Feb 2002 22:21:15 -0000	1.2
  +++ PoolComparisonProfileAbstract.java	13 Feb 2002 16:19:53 -0000	1.3
  @@ -27,7 +27,7 @@
    * Used as a basis for the PoolComparisonProfile Tests
    *
    * @author <a href="mailto:leif@silveregg.co.jp">Leif Mortenson</a>
  - * @version $Id: PoolComparisonProfileAbstract.java,v 1.2 2002/02/12 22:21:15 bloritsch Exp $
  + * @version $Id: PoolComparisonProfileAbstract.java,v 1.3 2002/02/13 16:19:53 bloritsch Exp $
    */
   public abstract class PoolComparisonProfileAbstract
       extends TestCase
  @@ -62,378 +62,165 @@
       }
   
       /*---------------------------------------------------------------
  -     * SoftResourceLimitingPool vs ResourceLimitingPool TestCases
  -     *-------------------------------------------------------------*/
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are small objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables";
  -
  -        Class         poolableClass = SmallPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are small objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_SmallPoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_SmallPoolables";
  -
  -        Class         poolableClass = SmallPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
  -    }
  -
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are medium objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables";
  -
  -        Class         poolableClass = MediumPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are medium objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_MediumPoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_MediumPoolables";
  -
  -        Class         poolableClass = MediumPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
  -    }
  -
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are large objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables";
  -
  -        Class         poolableClass = LargePoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SoftResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SoftResourceLimitingPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are large objects.
  -     */
  -    public void testCompare_SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_LargePoolables()
  -        throws Exception
  -    {
  -        String name = "SoftResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets20_LargePoolables";
  -
  -        Class         poolableClass = LargePoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SoftResourceLimitingPool poolA = new SoftResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
  -    }
  -
  -    /*---------------------------------------------------------------
  -     * HardResourceLimitingPool vs ResourceLimitingPool TestCases
  +     * FixedSizePool vs ResourceLimitingPool TestCases
        *-------------------------------------------------------------*/
       /**
  -     * Compare the HardResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
  +     * Compare the FixedSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are small objects.
        */
  -    public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables()
  +    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
           throws Exception
       {
  -        String name = "HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables";
  +        String name = "FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables";
   
           Class         poolableClass = SmallPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  +        int           max          = 100;
           boolean       maxStrict    = true;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
   
  -        HardResourceLimitingPool poolA = new HardResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  +        FixedSizePool poolA = new FixedSizePool( factory, max );
   
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /**
  -     * Compare the HardResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
  +     * Compare the FixedSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are medium objects.
        */
  -    public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
  +    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables()
           throws Exception
       {
  -        String name = "HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables";
  +        String name = "FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables";
   
           Class         poolableClass = MediumPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  +        int           max          = 100;
           boolean       maxStrict    = true;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
   
  -        HardResourceLimitingPool poolA = new HardResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  +        FixedSizePool poolA = new FixedSizePool( factory, max );
   
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /**
  -     * Compare the HardResourceLimitingPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a HardResourceLimitingPool.
  +     * Compare the FixedSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are large objects.
        */
  -    public void testCompare_HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables()
  +    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
           throws Exception
       {
  -        String name = "HardResourceLimitingPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables";
  +        String name = "FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables";
   
           Class         poolableClass = LargePoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  +        int           max          = 100;
           boolean       maxStrict    = true;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
   
  -        HardResourceLimitingPool poolA = new HardResourceLimitingPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  +        FixedSizePool poolA = new FixedSizePool( factory, max );
   
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /*---------------------------------------------------------------
  -     * FixedSizePool vs ResourceLimitingPool TestCases
  +     * FixedSizePool vs VariableSizePool TestCases
        *-------------------------------------------------------------*/
       /**
  -     * Compare the FixedSizePool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a FixedSizePool.
  +     * Compare the FixedSizePool and VariableSizePool when the
  +     *  VariableSizePool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are small objects.
        */
  -    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables()
  +    public void testCompare_FixedSizePool_And_VariableSizePool_Max100_Gets100_SmallPoolables()
           throws Exception
       {
  -        String name = "FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables";
  +        String name = "FixedSizePool_And_VariableSizePool_Max100_Gets100_SmallPoolables";
   
           Class         poolableClass = SmallPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  +        int           max          = 100;
   
           FixedSizePool poolA = new FixedSizePool( factory, max );
   
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  +        VariableSizePool poolB = new VariableSizePool( factory, max );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /**
  -     * Compare the FixedSizePool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a FixedSizePool.
  +     * Compare the FixedSizePool and VariableSizePool when the
  +     *  VariableSizePool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are medium objects.
        */
  -    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
  +    public void testCompare_FixedSizePool_And_VariableSizePool_Max100_Gets100_MediumPoolables()
           throws Exception
       {
  -        String name = "FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables";
  +        String name = "FixedSizePool_And_VariableSizePool_Max100_Gets100_MediumPoolables";
   
           Class         poolableClass = MediumPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  +        int           max          = 100;
   
           FixedSizePool poolA = new FixedSizePool( factory, max );
   
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  +        VariableSizePool poolB = new VariableSizePool( factory, max );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /**
  -     * Compare the FixedSizePool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a FixedSizePool.
  +     * Compare the FixedSizePool and VariableSizePool when the
  +     *  VariableSizePool is configured to act like a FixedSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are large objects.
        */
  -    public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables()
  +    public void testCompare_FixedSizePool_And_VariableSizePool_Max100_Gets100_LargePoolables()
           throws Exception
       {
  -        String name = "FixedSizePool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables";
  +        String name = "FixedSizePool_And_VariableSizePool_Max100_Gets100_LargePoolables";
   
           Class         poolableClass = LargePoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  +        int           max          = 100;
   
           FixedSizePool poolA = new FixedSizePool( factory, max );
   
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  +        VariableSizePool poolB = new VariableSizePool( factory, max );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /*---------------------------------------------------------------
  @@ -505,19 +292,19 @@
        * Compare the VariableSizePool and ResourceLimitingPool when the
        *  ResourceLimitingPool is configured to act like a VariableSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are small objects.
        */
  -    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables()
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables()
           throws Exception
       {
  -        String name = "VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables";
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max100_Gets100_SmallPoolables";
   
           Class         poolableClass = SmallPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
  @@ -527,26 +314,84 @@
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
       }
   
       /**
        * Compare the VariableSizePool and ResourceLimitingPool when the
        *  ResourceLimitingPool is configured to act like a VariableSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 200 at a time,
  +     *  Poolables are small objects.
  +     */
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_SmallPoolables()
  +        throws Exception
  +    {
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_SmallPoolables";
  +
  +        Class         poolableClass = SmallPoolable.class;
  +        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  +        int           min          = 0;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
  +        boolean       blocking     = false;
  +        long          blockTimeout = 0;
  +        long          trimInterval = 0;
  +
  +        VariableSizePool poolA = new VariableSizePool( factory, max );
  +
  +        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  +        poolB.enableLogging( m_poolLogger );
  +
  +        generalTest( name, poolA, poolB, 200, factory );
  +    }
  +
  +    /**
  +     * Compare the VariableSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a VariableSizePool.
  +     * <p>
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are medium objects.
        */
  -    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables()
           throws Exception
       {
  -        String name = "VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables";
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max10_Gets100_MediumPoolables";
   
           Class         poolableClass = MediumPoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
  +        boolean       blocking     = false;
  +        long          blockTimeout = 0;
  +        long          trimInterval = 0;
  +
  +        VariableSizePool poolA = new VariableSizePool( factory, max );
  +
  +        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  +        poolB.enableLogging( m_poolLogger );
  +
  +        generalTest( name, poolA, poolB, 100, factory );
  +    }
  +
  +    /**
  +     * Compare the VariableSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a VariableSizePool.
  +     * <p>
  +     * Test will use pools with a max size of 100, while getting up to 200 at a time,
  +     *  Poolables are medium objects.
  +     */
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_MediumPoolables()
  +        throws Exception
  +    {
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_MediumPoolables";
  +
  +        Class         poolableClass = MediumPoolable.class;
  +        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  +        int           min          = 0;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
  @@ -556,26 +401,26 @@
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 200, factory );
       }
   
       /**
        * Compare the VariableSizePool and ResourceLimitingPool when the
        *  ResourceLimitingPool is configured to act like a VariableSizePool.
        * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  +     * Test will use pools with a max size of 100, while getting up to 100 at a time,
        *  Poolables are large objects.
        */
  -    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables()
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables()
           throws Exception
       {
  -        String name = "VariableSizePool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables";
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max100_Gets100_LargePoolables";
   
           Class         poolableClass = LargePoolable.class;
           ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
           int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = true;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
           boolean       blocking     = false;
           long          blockTimeout = 0;
           long          trimInterval = 0;
  @@ -585,7 +430,36 @@
           ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
           poolB.enableLogging( m_poolLogger );
   
  -        generalTest( name, poolA, poolB, 10, factory );
  +        generalTest( name, poolA, poolB, 100, factory );
  +    }
  +
  +    /**
  +     * Compare the VariableSizePool and ResourceLimitingPool when the
  +     *  ResourceLimitingPool is configured to act like a VariableSizePool.
  +     * <p>
  +     * Test will use pools with a max size of 100, while getting up to 200 at a time,
  +     *  Poolables are large objects.
  +     */
  +    public void testCompare_VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_LargePoolables()
  +        throws Exception
  +    {
  +        String name = "VariableSizePool_And_ResourceLimitingPool_Max100_Gets200_LargePoolables";
  +
  +        Class         poolableClass = LargePoolable.class;
  +        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  +        int           min          = 0;
  +        int           max          = 100;
  +        boolean       maxStrict    = false;
  +        boolean       blocking     = false;
  +        long          blockTimeout = 0;
  +        long          trimInterval = 0;
  +
  +        VariableSizePool poolA = new VariableSizePool( factory, max );
  +
  +        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  +        poolB.enableLogging( m_poolLogger );
  +
  +        generalTest( name, poolA, poolB, 200, factory );
       }
   
       /*---------------------------------------------------------------
  @@ -676,55 +550,6 @@
        * The guts of the various test cases.  Will dispose the pools
        */
       protected void generalTest(String name, Pool poolA, org.apache.avalon.excalibur.pool.Pool poolB, int gets, ClassInstanceObjectFactory factory)
  -        throws Exception
  -    {
  -        m_logger.info( "Test Case: " + name );
  -
  -        // Get the short class names
  -        final String poolAName = getShortClassName( poolA );
  -        final String poolBName = getShortClassName( poolB );
  -
  -        // Start clean
  -        resetMemory();
  -
  -        // Get a baseline speed for object creation
  -        NoPoolingPool poolBase = new NoPoolingPool( factory );
  -        poolBase.enableLogging( m_poolLogger );
  -        final long noPoolDuration = getPoolRunTime( poolBase, gets );
  -        m_logger.info( "     Unpooled time = " + noPoolDuration + "ms. to use " + TEST_SIZE + " objects." );
  -        resetMemory();
  -
  -
  -        // Get the time for poolA
  -        final long poolADuration = getPoolRunTime( poolA, gets );
  -        m_logger.info( "     " + poolAName + " time = " + poolADuration + "ms. to use " + TEST_SIZE + " objects, " + gets + " at a time." );
  -        resetMemory();
  -
  -
  -        // Get the time for poolB
  -        final long poolBDuration = getPoolRunTime( poolB, gets );
  -        m_logger.info( "     " + poolBName + " time = " + poolBDuration + "ms. to use " + TEST_SIZE + " objects, " + gets + " at a time." );
  -        resetMemory();
  -
  -        // Show a summary
  -        if ( m_logger.isInfoEnabled() )
  -        {
  -            double mult;
  -            mult = ( poolADuration > 0 ? ( noPoolDuration * 100 / poolADuration ) / 100.0 : Float.POSITIVE_INFINITY );
  -            m_logger.info( "  => " + poolAName + " is " + mult + " X as fast as not pooling." );
  -
  -            mult = ( poolBDuration > 0 ? ( noPoolDuration * 100 / poolBDuration ) / 100.0 : Float.POSITIVE_INFINITY );
  -            m_logger.info( "  => " + poolBName + " is " + mult + " X as fast as not pooling." );
  -
  -            mult = ( poolBDuration > 0 ? ( poolADuration * 100 / poolBDuration ) / 100.0 : Float.POSITIVE_INFINITY );
  -            m_logger.info( "  => " + poolBName + " is " + mult + " X as fast as " + poolAName + "." );
  -        }
  -    }
  -
  -    /**
  -     * The guts of the various test cases.  Will dispose the pools
  -     */
  -    protected void generalTest(String name, org.apache.avalon.excalibur.pool.Pool poolA, org.apache.avalon.excalibur.pool.Pool poolB, int gets, ClassInstanceObjectFactory factory)
           throws Exception
       {
           m_logger.info( "Test Case: " + name );
  
  
  
  1.3       +1 -190    jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/SingleThreadedPoolComparisonProfile.java
  
  Index: SingleThreadedPoolComparisonProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/mpool/test/SingleThreadedPoolComparisonProfile.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SingleThreadedPoolComparisonProfile.java	12 Feb 2002 22:21:15 -0000	1.2
  +++ SingleThreadedPoolComparisonProfile.java	13 Feb 2002 16:19:53 -0000	1.3
  @@ -29,7 +29,7 @@
    *  given a single access thread.
    *
    * @author <a href="mailto:leif@silveregg.co.jp">Leif Mortenson</a>
  - * @version $Id: SingleThreadedPoolComparisonProfile.java,v 1.2 2002/02/12 22:21:15 bloritsch Exp $
  + * @version $Id: SingleThreadedPoolComparisonProfile.java,v 1.3 2002/02/13 16:19:53 bloritsch Exp $
    */
   public class SingleThreadedPoolComparisonProfile
       extends PoolComparisonProfileAbstract
  @@ -40,195 +40,6 @@
       public SingleThreadedPoolComparisonProfile(String name)
       {
           super(name);
  -    }
  -
  -    /*---------------------------------------------------------------
  -     * SingleThreadedPool vs ResourceLimitingPool TestCases
  -     *-------------------------------------------------------------*/
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are small objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_SmallPoolables";
  -
  -        Class         poolableClass = SmallPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are small objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_SmallPoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_SmallPoolables";
  -
  -        Class         poolableClass = SmallPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
  -    }
  -
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are medium objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_MediumPoolables";
  -
  -        Class         poolableClass = MediumPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are medium objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_MediumPoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_MediumPoolables";
  -
  -        Class         poolableClass = MediumPoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
  -    }
  -
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 10 at a time,
  -     *  Poolables are large objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets10_LargePoolables";
  -
  -        Class         poolableClass = LargePoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 10, factory );
  -    }
  -
  -    /**
  -     * Compare the SingleThreadedPool and ResourceLimitingPool when the
  -     *  ResourceLimitingPool is configured to act like a SingleThreadedPool.
  -     * <p>
  -     * Test will use pools with a max size of 10, while getting up to 20 at a time,
  -     *  Poolables are large objects.
  -     */
  -    public void testCompare_SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_LargePoolables()
  -        throws Exception
  -    {
  -        String name = "SingleThreadedPool_And_ResourceLimitingPool_Max10_Gets20_LargePoolables";
  -
  -        Class         poolableClass = LargePoolable.class;
  -        ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
  -        int           min          = 0;
  -        int           max          = 10;
  -        boolean       maxStrict    = false;
  -        boolean       blocking     = false;
  -        long          blockTimeout = 0;
  -        long          trimInterval = 0;
  -
  -        SingleThreadedPool poolA = new SingleThreadedPool( factory, min, max );
  -        poolA.enableLogging( m_poolLogger );
  -        poolA.initialize();
  -
  -        ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
  -        poolB.enableLogging( m_poolLogger );
  -
  -        generalTest( name, poolA, poolB, 20, factory );
       }
   
       /*---------------------------------------------------------------
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message