commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons/pool/src/test/org/apache/commons/pool/impl TestGenericObjectPool.java TestGenericKeyedObjectPool.java
Date Sat, 04 May 2002 12:15:46 GMT
rwaldhoff    02/05/04 05:15:46

  Modified:    pool/src/test/org/apache/commons/pool/impl
                        TestGenericObjectPool.java
                        TestGenericKeyedObjectPool.java
  Log:
  make tests a little bit shorter
  make KeyedObjectPool tests a little bit stronger
  
  Revision  Changes    Path
  1.5       +6 -6      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestGenericObjectPool.java	1 May 2002 06:02:35 -0000	1.4
  +++ TestGenericObjectPool.java	4 May 2002 12:15:46 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java,v
1.4 2002/05/01 06:02:35 rwaldhoff Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/05/01 06:02:35 $
  + * $Header: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java,v
1.5 2002/05/04 12:15:46 rwaldhoff Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/05/04 12:15:46 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,7 @@
   
   /**
    * @author Rodney Waldhoff
  - * @version $Id: TestGenericObjectPool.java,v 1.4 2002/05/01 06:02:35 rwaldhoff Exp $
  + * @version $Id: TestGenericObjectPool.java,v 1.5 2002/05/04 12:15:46 rwaldhoff Exp $
    */
   public class TestGenericObjectPool extends TestCase {
       public TestGenericObjectPool(String testName) {
  @@ -208,7 +208,7 @@
               pool.returnObject(active[i]);
           }
   
  -        try { Thread.currentThread().sleep(2000L); } catch(Exception e) { }
  +        try { Thread.currentThread().sleep(1000L); } catch(Exception e) { }
           assertTrue("Should be less than 500 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 500);
           try { Thread.currentThread().sleep(600L); } catch(Exception e) { }
           assertTrue("Should be less than 400 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 400);
  @@ -228,7 +228,7 @@
               pool.returnObject(active[i]);
           }
   
  -        try { Thread.currentThread().sleep(2000L); } catch(Exception e) { }
  +        try { Thread.currentThread().sleep(1000L); } catch(Exception e) { }
           assertTrue("Should be less than 500 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 500);
           try { Thread.currentThread().sleep(600L); } catch(Exception e) { }
           assertTrue("Should be less than 400 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 400);
  
  
  
  1.5       +10 -9     jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
  
  Index: TestGenericKeyedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestGenericKeyedObjectPool.java	1 May 2002 06:33:02 -0000	1.4
  +++ TestGenericKeyedObjectPool.java	4 May 2002 12:15:46 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java,v
1.4 2002/05/01 06:33:02 rwaldhoff Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/05/01 06:33:02 $
  + * $Header: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java,v
1.5 2002/05/04 12:15:46 rwaldhoff Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/05/04 12:15:46 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,7 @@
   
   /**
    * @author Rodney Waldhoff
  - * @version $Id: TestGenericKeyedObjectPool.java,v 1.4 2002/05/01 06:33:02 rwaldhoff Exp
$
  + * @version $Id: TestGenericKeyedObjectPool.java,v 1.5 2002/05/04 12:15:46 rwaldhoff Exp
$
    */
   public class TestGenericKeyedObjectPool extends TestCase {
       public TestGenericKeyedObjectPool(String testName) {
  @@ -257,7 +257,7 @@
               pool.returnObject("",active[i]);
           }
   
  -        try { Thread.currentThread().sleep(2000L); } catch(Exception e) { }
  +        try { Thread.currentThread().sleep(1000L); } catch(Exception e) { }
           assertTrue("Should be less than 500 idle, found " + pool.getNumIdle(""),pool.getNumIdle("")
< 500);
           try { Thread.currentThread().sleep(600L); } catch(Exception e) { }
           assertTrue("Should be less than 400 idle, found " + pool.getNumIdle(""),pool.getNumIdle("")
< 400);
  @@ -277,7 +277,7 @@
               pool.returnObject("",active[i]);
           }
   
  -        try { Thread.currentThread().sleep(2000L); } catch(Exception e) { }
  +        try { Thread.currentThread().sleep(1000L); } catch(Exception e) { }
           assertTrue("Should be less than 500 idle, found " + pool.getNumIdle(""),pool.getNumIdle("")
< 500);
           try { Thread.currentThread().sleep(600L); } catch(Exception e) { }
           assertTrue("Should be less than 400 idle, found " + pool.getNumIdle(""),pool.getNumIdle("")
< 400);
  @@ -309,7 +309,7 @@
               pool.returnObject("2",active2[i]);
           }
   
  -        try { Thread.currentThread().sleep(2000L); } catch(Exception e) { }
  +        try { Thread.currentThread().sleep(1000L); } catch(Exception e) { }
           assertTrue("Should be less than 1000 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 1000);
           try { Thread.currentThread().sleep(600L); } catch(Exception e) { }
           assertTrue("Should be less than 900 idle, found " + pool.getNumIdle(),pool.getNumIdle()
< 900);
  @@ -390,6 +390,7 @@
   
           public void run() {
               for(int i=0;i<_iter;i++) {
  +                String key = String.valueOf(_random.nextInt(3));
                   try {
                       Thread.currentThread().sleep((long)_random.nextInt(_delay));
                   } catch(Exception e) {
  @@ -397,7 +398,7 @@
                   }
                   Object obj = null;
                   try {
  -                    obj = _pool.borrowObject("");
  +                    obj = _pool.borrowObject(key);
                   } catch(Exception e) {
                       _failed = true;
                       _complete = true;
  @@ -410,7 +411,7 @@
                       // ignored
                   }
                   try {
  -                    _pool.returnObject("",obj);
  +                    _pool.returnObject(key,obj);
                   } catch(Exception e) {
                       _failed = true;
                       _complete = true;
  
  
  

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


Mime
View raw message