commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons/pool/src/test/org/apache/commons/pool TestBaseKeyedObjectPool.java
Date Thu, 24 Apr 2003 20:14:04 GMT
rwaldhoff    2003/04/24 13:14:03

  Modified:    pool/src/test/org/apache/commons/pool/impl
                        TestStackKeyedObjectPool.java
                        TestGenericKeyedObjectPool.java
               pool/src/test/org/apache/commons/pool
                        TestBaseKeyedObjectPool.java
  Log:
  more tests
  
  Revision  Changes    Path
  1.9       +15 -6     jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestStackKeyedObjectPool.java
  
  Index: TestStackKeyedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestStackKeyedObjectPool.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestStackKeyedObjectPool.java	7 Mar 2003 20:28:35 -0000	1.8
  +++ TestStackKeyedObjectPool.java	24 Apr 2003 20:14:03 -0000	1.9
  @@ -66,17 +66,17 @@
   import java.util.NoSuchElementException;
   
   import junit.framework.Test;
  -import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
   import org.apache.commons.pool.KeyedObjectPool;
   import org.apache.commons.pool.KeyedPoolableObjectFactory;
  +import org.apache.commons.pool.TestKeyedObjectPool;
   
   /**
    * @author Rodney Waldhoff
    * @version $Revision$ $Date$
    */
  -public class TestStackKeyedObjectPool extends TestCase {
  +public class TestStackKeyedObjectPool extends TestKeyedObjectPool {
       public TestStackKeyedObjectPool(String testName) {
           super(testName);
       }
  @@ -201,6 +201,15 @@
           {
               StackKeyedObjectPool pool = new StackKeyedObjectPool(null,10,5);
           }
  +    }
  +    
  +    public void testToString() throws Exception {
  +        StackKeyedObjectPool pool = new StackKeyedObjectPool(new SimpleFactory());
  +        assertNotNull(pool.toString());
  +        Object obj = pool.borrowObject("key");
  +        assertNotNull(pool.toString());
  +        pool.returnObject("key",obj);
  +        assertNotNull(pool.toString());
       }
           
       public void testBorrowFromEmptyPoolWithNullFactory() throws Exception {
  
  
  
  1.13      +5 -4      jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
  
  Index: TestGenericKeyedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestGenericKeyedObjectPool.java	18 Apr 2003 20:58:40 -0000	1.12
  +++ TestGenericKeyedObjectPool.java	24 Apr 2003 20:14:03 -0000	1.13
  @@ -125,6 +125,7 @@
       
       public void tearDown() throws Exception {
           super.tearDown();
  +        pool.close();
           pool = null;
       }
   
  
  
  
  1.2       +11 -4     jakarta-commons/pool/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java
  
  Index: TestBaseKeyedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBaseKeyedObjectPool.java	22 Apr 2003 23:14:52 -0000	1.1
  +++ TestBaseKeyedObjectPool.java	24 Apr 2003 20:14:03 -0000	1.2
  @@ -90,6 +90,13 @@
           };   
           
           try {
  +            pool.addObject("key");
  +            fail("Expected UnsupportedOperationException");
  +        } catch(UnsupportedOperationException e) {
  +            // expected
  +        }
  +
  +        try {
               pool.getNumIdle();
               fail("Expected UnsupportedOperationException");
           } catch(UnsupportedOperationException e) {
  
  
  

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