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/dbcp/src/test/org/apache/commons/dbcp TestAbandonedObjectPool.java
Date Tue, 04 May 2004 17:56:10 GMT
dirkv       2004/05/04 10:56:10

  Modified:    dbcp/src/test/org/apache/commons/dbcp
                        TestAbandonedObjectPool.java
  Log:
  - call Thread.yield() instead of sleeping
  - removed a few lingering tabs
  (patch from Wayne Woodfield)
  
  Revision  Changes    Path
  1.2       +11 -11    jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestAbandonedObjectPool.java
  
  Index: TestAbandonedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestAbandonedObjectPool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAbandonedObjectPool.java	1 May 2004 12:43:12 -0000	1.1
  +++ TestAbandonedObjectPool.java	4 May 2004 17:56:10 -0000	1.2
  @@ -44,13 +44,13 @@
   
       public void setUp() throws Exception {
           super.setUp();
  -		config = new AbandonedConfig();
  +        config = new AbandonedConfig();
           
           // -- Uncomment the following line to enable logging -- 
           // config.setLogAbandoned(true);
           
  -		config.setRemoveAbandoned(true);
  -		config.setRemoveAbandonedTimeout(1);
  +        config.setRemoveAbandoned(true);
  +        config.setRemoveAbandonedTimeout(1);
           pool = new AbandonedObjectPool(new SimpleFactory(), config);
       }
   
  @@ -60,10 +60,10 @@
           pool = null;
       }
   
  -	/**
  -	* Tests fix for Bug 28579, a bug in AbandonedObjectPool that causes numActive to go negative
  -	* in GenericObjectPool
  -	*/
  +    /**
  +    * Tests fix for Bug 28579, a bug in AbandonedObjectPool that causes numActive to go
negative
  +    * in GenericObjectPool
  +    */
       public void testConcurrentInvalidation() throws Exception {
           final int POOL_SIZE = 30;
           pool.setMaxActive(POOL_SIZE);
  @@ -140,9 +140,9 @@
   
           public void destroyObject(Object obj) {
               ((PooledTestObject)obj).setActive(false);
  -            // destroying an object will often take a few milliseconds, especially when
the object is a network connection
  -            try { Thread.sleep(30); }
  -            catch (InterruptedException e) { }
  +            // while destroying connections, yield control to other threads
  +            // helps simulate threading errors
  +            Thread.yield();
           }
       }
   }
  
  
  

---------------------------------------------------------------------
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