You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2012/04/12 22:34:08 UTC

svn commit: r1325494 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java

Author: markt
Date: Thu Apr 12 20:34:08 2012
New Revision: 1325494

URL: http://svn.apache.org/viewvc?rev=1325494&view=rev
Log:
Include names of pools in any failure message to aid debugging

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

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java?rev=1325494&r1=1325493&r2=1325494&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java Thu Apr 12 20:34:08 2012
@@ -85,6 +85,7 @@ public class TestGenericObjectPool exten
 
     @After
     public void tearDown() throws Exception {
+        String poolName = pool.getJmxName().toString();
         pool.clear();
         pool.close();
         pool = null;
@@ -95,11 +96,16 @@ public class TestGenericObjectPool exten
                 "org.apache.commoms.pool2:type=GenericObjectPool,*"), null);
         // There should be no registered pools at this point
         int registeredPoolCount = result.size();
+        StringBuffer msg = new StringBuffer("Current pool is: ");
+        msg.append(poolName);
+        msg.append("  Still open pools are: ");
         for (ObjectName name : result) {
             // Clean these up ready for the next test
+            msg.append(name.toString());
+            msg.append(' ');
             mbs.unregisterMBean(name);
         }
-        Assert.assertEquals(0, registeredPoolCount);
+        Assert.assertEquals(msg.toString(), 0, registeredPoolCount);
     }
 
     @Test(timeout=60000)