dirkv 2004/06/29 13:04:43
Modified: pool/src/test/org/apache/commons/pool/impl
TestGenericObjectPool.java
Log:
Bugzilla Bug 29863: GenericObjectPool.setMaxActive(0) allows an infinite number of
instances
- junit test
Revision Changes Path
1.22 +13 -1
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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- TestGenericObjectPool.java 28 Feb 2004 12:21:41 -0000 1.21
+++ TestGenericObjectPool.java 29 Jun 2004 20:04:43 -0000 1.22
@@ -259,6 +259,18 @@
}
}
+ public void testMaxActiveZero() throws Exception {
+ pool.setMaxActive(0);
+ pool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_FAIL);
+
+ try {
+ pool.borrowObject();
+ fail("Expected NoSuchElementException");
+ } catch(NoSuchElementException e) {
+ // expected
+ }
+ }
+
public void testInvalidWhenExhaustedAction() throws Exception {
try {
pool.setWhenExhaustedAction(Byte.MAX_VALUE);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]