On 5 May 2012 11:13, <s...@apache.org> wrote: > Author: sebb > Date: Sat May 5 10:13:22 2012 > New Revision: 1334378 > > URL: http://svn.apache.org/viewvc?rev=1334378&view=rev > Log: > Add ctor tests, including null factory > TODO determine why JMX cannot find creationStackTrace
I had to update tearDown because it was failing to find the attribute. Not sure why this is the case. Does not seem to be able to find any attributes. > Modified: > > commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java > > Modified: > commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java?rev=1334378&r1=1334377&r2=1334378&view=diff > ============================================================================== > --- > commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java > (original) > +++ > commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java > Sat May 5 10:13:22 2012 > @@ -31,15 +31,16 @@ import java.util.Random; > import java.util.Set; > import java.util.concurrent.atomic.AtomicInteger; > > +import javax.management.AttributeNotFoundException; > import javax.management.MBeanServer; > import javax.management.Notification; > import javax.management.NotificationListener; > import javax.management.ObjectName; > > import org.apache.commons.pool2.BasePoolableObjectFactory; > +import org.apache.commons.pool2.PoolableObjectFactory; > import org.apache.commons.pool2.ObjectPool; > import org.apache.commons.pool2.PoolUtils; > -import org.apache.commons.pool2.PoolableObjectFactory; > import org.apache.commons.pool2.TestBaseObjectPool; > import org.apache.commons.pool2.VisitTracker; > import org.apache.commons.pool2.VisitTrackerFactory; > @@ -100,13 +101,103 @@ public class TestGenericObjectPool exten > // Clean these up ready for the next test > msg.append(name.toString()); > msg.append(" created via\n"); > - msg.append(mbs.getAttribute(name, "creationStackTrace")); > + try { > + msg.append(mbs.getAttribute(name, "creationStackTrace")); > + } catch (AttributeNotFoundException e) { > + msg.append(e.getMessage()); > + } > msg.append('\n'); > mbs.unregisterMBean(name); > } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org