commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r899605 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Date Fri, 15 Jan 2010 12:00:56 GMT
Author: sebb
Date: Fri Jan 15 12:00:56 2010
New Revision: 899605

URL: http://svn.apache.org/viewvc?rev=899605&view=rev
Log:
More debug: show object id

Modified:
    commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java?rev=899605&r1=899604&r2=899605&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Fri Jan 15 12:00:56 2010
@@ -1341,6 +1341,10 @@
 
     private static final boolean DISPLAY_THREAD_DETAILS=
         Boolean.valueOf(System.getProperty("TestGenericKeyedObjectPool.display.thread.details",
"false")).booleanValue();
+    // To pass this to a Maven test, use:
+    // mvn test -DargLine="-DTestGenericKeyedObjectPool.display.thread.details=true"
+    // @see http://jira.codehaus.org/browse/SUREFIRE-121
+
     /*
      * Test multi-threaded pool access.
      * Multiple keys, multiple threads, but maxActive only allows half the threads to succeed.
@@ -1385,6 +1389,7 @@
                         + " PostReturn: "+(wt.postreturn != 0 ? wt.postreturn-origin : -1)
                         + " Ended: "+(wt.ended-origin)
                         + " Key: "+(wt._key)
+                        + " ObjId: "+wt.objectId
                         );
             }            
         }
@@ -1427,6 +1432,7 @@
         private long postborrow; //  borrow returned
         private long postreturn; // after object was returned
         private long ended;
+        private String objectId;
 
         public WaitingTestThread(KeyedObjectPool pool, String key, long pause) {
             _pool = pool;
@@ -1439,6 +1445,7 @@
             try {
                 preborrow = System.currentTimeMillis();
                 Object obj = _pool.borrowObject(_key);
+                objectId=obj.toString();
                 postborrow = System.currentTimeMillis();
                 Thread.sleep(_pause);
                 _pool.returnObject(_key, obj);



Mime
View raw message