commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/pool/src/test/org/apache/commons/pool/impl TestGenericObjectPool.java
Date Tue, 10 Aug 2004 19:58:07 GMT
dirkv       2004/08/10 12:58:07

  Modified:    pool/src/test/org/apache/commons/pool/impl
                        TestGenericObjectPool.java
  Log:
  JUnit test for maxIdle=0
  
  Revision  Changes    Path
  1.25      +17 -1     jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
  
  Index: TestGenericObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- TestGenericObjectPool.java	10 Aug 2004 19:39:13 -0000	1.24
  +++ TestGenericObjectPool.java	10 Aug 2004 19:58:07 -0000	1.25
  @@ -237,6 +237,22 @@
           }
       }
   
  +    public void testMaxIdleZero() throws Exception {
  +        pool.setMaxActive(100);
  +        pool.setMaxIdle(0);
  +        Object[] active = new Object[100];
  +        for(int i=0;i<100;i++) {
  +            active[i] = pool.borrowObject();
  +        }
  +        assertEquals(100,pool.getNumActive());
  +        assertEquals(0,pool.getNumIdle());
  +        for(int i=0;i<100;i++) {
  +            pool.returnObject(active[i]);
  +            assertEquals(99 - i,pool.getNumActive());
  +            assertEquals(0, pool.getNumIdle());
  +        }
  +    }
  +
       public void testMaxActive() throws Exception {
           pool.setMaxActive(3);
           pool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_FAIL);
  
  
  

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


Mime
View raw message