jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asm...@apache.org
Subject svn commit: r476169 - in /jakarta/jcs/trunk/src: test-conf/thread_pool.properties test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
Date Fri, 17 Nov 2006 15:08:25 GMT
Author: asmuts
Date: Fri Nov 17 07:08:24 2006
New Revision: 476169

URL: http://svn.apache.org/viewvc?view=rev&rev=476169
Log:
Fixing stupid error in the thread pool manager.  If you specify the useBoundary value, it
would alwasy be false.  If you didn't then it would be true!

JCS-14

Modified:
    jakarta/jcs/trunk/src/test-conf/thread_pool.properties
    jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java

Modified: jakarta/jcs/trunk/src/test-conf/thread_pool.properties
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test-conf/thread_pool.properties?view=diff&rev=476169&r1=476168&r2=476169
==============================================================================
--- jakarta/jcs/trunk/src/test-conf/thread_pool.properties (original)
+++ jakarta/jcs/trunk/src/test-conf/thread_pool.properties Fri Nov 17 07:08:24 2006
@@ -36,6 +36,16 @@
 thread_pool.waittest.whenBlockedPolicy=WAIT
 thread_pool.waittest.startUpSize=1
 
+# with boundary test thread pool config
+thread_pool.withbound.useBoundary=true
+thread_pool.withbound.boundarySize=1000
+thread_pool.withbound.maximumPoolSize=11
+thread_pool.withbound.minimumPoolSize=1
+thread_pool.withbound.keepAliveTime=1
+thread_pool.withbound.whenBlockedPolicy=WAIT
+thread_pool.withbound.startUpSize=1
+
+
 # no boundary test thread pool config
 thread_pool.nobound.useBoundary=false
 thread_pool.nobound.boundarySize=1000

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java?view=diff&rev=476169&r1=476168&r2=476169
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
(original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
Fri Nov 17 07:08:24 2006
@@ -6,6 +6,7 @@
 
 import org.apache.jcs.utils.props.PropertyLoader;
 
+import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
 
 /**
@@ -159,6 +160,23 @@
         assertNotNull( "Should have gotten back a pool.", pool );
 
         assertTrue( "Should have a linked queue and not a bounded buffer.", pool.getQueue()
instanceof LinkedQueue );
-
     }
+    
+    /**
+     * Verify that if we specify useBoundary=true that we get a BoundedBuffer.
+     *
+     */
+    public void testWithBoundary()
+    {
+        ThreadPoolManager.setPropsFileName( "thread_pool.properties" );
+        ThreadPoolManager mgr = ThreadPoolManager.getInstance();
+        // force config from new props file
+        mgr.configure();
+        assertNotNull( mgr );
+
+        ThreadPool pool = mgr.getPool( "withbound" );
+        assertNotNull( "Should have gotten back a pool.", pool );
+
+        assertTrue( "Should have a BoundedBuffer and not a linked queue.", pool.getQueue()
instanceof BoundedBuffer );
+    }    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


Mime
View raw message