commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1330174 - in /commons/proper/dbcp/trunk/src: java/org/apache/commons/dbcp2/ java/org/apache/commons/dbcp2/cpdsadapter/ java/org/apache/commons/dbcp2/datasources/ java/org/apache/commons/dbcp2/managed/ test/org/apache/commons/dbcp2/ test/or...
Date Wed, 25 Apr 2012 09:49:23 GMT
Author: markt
Date: Wed Apr 25 09:49:22 2012
New Revision: 1330174

URL: http://svn.apache.org/viewvc?rev=1330174&view=rev
Log:
Updates for maxWait -> maxWaitMillis

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java Wed Apr
25 09:49:22 2012
@@ -461,7 +461,8 @@ public class BasicDataSource implements 
      * are no available connections) for a connection to be returned before
      * throwing an exception, or <= 0 to wait indefinitely.
      */
-    protected long maxWait = GenericObjectPoolConfig.DEFAULT_MAX_WAIT;
+    protected long maxWaitMillis =
+            GenericObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS;
 
     /**
      * <p>Returns the maximum number of milliseconds that the pool will wait
@@ -470,25 +471,25 @@ public class BasicDataSource implements 
      * <p>A value less than or equal to zero means the pool is set to wait
      * indefinitely.</p>
      * 
-     * @return the maxWait property value
+     * @return the maxWaitMillis property value
      */
-    public synchronized long getMaxWait() {
-        return this.maxWait;
+    public synchronized long getMaxWaitMillis() {
+        return this.maxWaitMillis;
     }
 
     /**
-     * <p>Sets the maxWait property.
+     * <p>Sets the MaxWaitMillis property.
      * </p>
      * <p>Use -1 to make the pool wait indefinitely.
      * </p>
      * 
-     * @param maxWait the new value for maxWait
-     * @see #getMaxWait()
+     * @param MaxWaitMillis the new value for MaxWaitMillis
+     * @see #getMaxWaitMillis()
      */
-    public synchronized void setMaxWait(long maxWait) {
-        this.maxWait = maxWait;
+    public synchronized void setMaxWaitMillis(long maxWaitMillis) {
+        this.maxWaitMillis = maxWaitMillis;
         if (connectionPool != null) {
-            connectionPool.setMaxWait(maxWait);
+            connectionPool.setMaxWaitMillis(maxWaitMillis);
         }
     }
 
@@ -1694,7 +1695,7 @@ public class BasicDataSource implements 
         gop.setMaxTotal(maxTotal);
         gop.setMaxIdle(maxIdle);
         gop.setMinIdle(minIdle);
-        gop.setMaxWait(maxWait);
+        gop.setMaxWaitMillis(maxWaitMillis);
         gop.setTestOnBorrow(testOnBorrow);
         gop.setTestOnReturn(testOnReturn);
         gop.setNumTestsPerEvictionRun(numTestsPerEvictionRun);

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
Wed Apr 25 09:49:22 2012
@@ -57,7 +57,7 @@ public class BasicDataSourceFactory impl
     private final static String PROP_MAXIDLE = "maxIdle";
     private final static String PROP_MINIDLE = "minIdle";
     private final static String PROP_INITIALSIZE = "initialSize";
-    private final static String PROP_MAXWAIT = "maxWait";
+    private final static String PROP_MAXWAITMILLIS = "maxWaitMillis";
     private final static String PROP_TESTONBORROW = "testOnBorrow";
     private final static String PROP_TESTONRETURN = "testOnReturn";
     private final static String PROP_TIMEBETWEENEVICTIONRUNSMILLIS = "timeBetweenEvictionRunsMillis";
@@ -96,7 +96,7 @@ public class BasicDataSourceFactory impl
         PROP_MAXIDLE,
         PROP_MINIDLE,
         PROP_INITIALSIZE,
-        PROP_MAXWAIT,
+        PROP_MAXWAITMILLIS,
         PROP_TESTONBORROW,
         PROP_TESTONRETURN,
         PROP_TIMEBETWEENEVICTIONRUNSMILLIS,
@@ -256,9 +256,9 @@ public class BasicDataSourceFactory impl
             dataSource.setInitialSize(Integer.parseInt(value));
         }
 
-        value = properties.getProperty(PROP_MAXWAIT);
+        value = properties.getProperty(PROP_MAXWAITMILLIS);
         if (value != null) {
-            dataSource.setMaxWait(Long.parseLong(value));
+            dataSource.setMaxWaitMillis(Long.parseLong(value));
         }
 
         value = properties.getProperty(PROP_TESTONBORROW);

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
Wed Apr 25 09:49:22 2012
@@ -186,7 +186,7 @@ public class PoolableConnectionFactory
             GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
             config.setMaxTotalPerKey(-1);
             config.setBlockWhenExhausted(false);
-            config.setMaxWait(0);
+            config.setMaxWaitMillis(0);
             config.setMaxIdlePerKey(1);
             config.setMaxTotal(maxOpenPreparedStatements);
             KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> stmtPool =

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
Wed Apr 25 09:49:22 2012
@@ -194,7 +194,7 @@ public class DriverAdapterCPDS
             GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
             config.setMaxTotalPerKey(Integer.MAX_VALUE);
             config.setBlockWhenExhausted(false);
-            config.setMaxWait(0);
+            config.setMaxWaitMillis(0);
             config.setMaxIdlePerKey(getMaxIdle());
             if (getMaxPreparedStatements() <= 0)
             {

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
Wed Apr 25 09:49:22 2012
@@ -62,13 +62,13 @@ public class PerUserPoolDataSource
 
     private int defaultMaxTotal = GenericObjectPoolConfig.DEFAULT_MAX_TOTAL;
     private int defaultMaxIdle = GenericObjectPoolConfig.DEFAULT_MAX_IDLE;
-    private int defaultMaxWait = (int)Math.min(Integer.MAX_VALUE,
-            GenericObjectPoolConfig.DEFAULT_MAX_WAIT);
+    private int defaultMaxWaitMillis = (int)Math.min(Integer.MAX_VALUE,
+            GenericObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS);
     Map<String,Boolean> perUserDefaultAutoCommit = null;    
     Map<String,Integer> perUserDefaultTransactionIsolation = null;
     Map<String,Integer> perUserMaxTotal = null;    
     Map<String,Integer> perUserMaxIdle = null;    
-    Map<String,Integer> perUserMaxWait = null;
+    Map<String,Integer> perUserMaxWaitMillis = null;
     Map<String,Boolean> perUserDefaultReadOnly = null;    
 
     /**
@@ -149,10 +149,10 @@ public class PerUserPoolDataSource
      * throwing an exception, or -1 to wait indefinitely.  Will fail 
      * immediately if value is 0.
      * This value is used for any username which is not specified
-     * in perUserMaxWait.  The default is -1.
+     * in perUserMaxWaitMillis.  The default is -1.
      */
-    public int getDefaultMaxWait() {
-        return (this.defaultMaxWait);
+    public int getDefaultMaxWaitMillis() {
+        return (this.defaultMaxWaitMillis);
     }
 
     /**
@@ -161,11 +161,12 @@ public class PerUserPoolDataSource
      * throwing an exception, or -1 to wait indefinitely.  Will fail 
      * immediately if value is 0.
      * This value is used for any username which is not specified
-     * in perUserMaxWait.  The default is -1.
+     * in perUserMaxWaitMillis.  The default is -1.
      */
-    public void setDefaultMaxWait(int defaultMaxWait) {
+    public void setDefaultMaxWaitMillis(int defaultMaxWaitMillis
+            ) {
         assertInitializationAllowed();
-        this.defaultMaxWait = defaultMaxWait;
+        this.defaultMaxWaitMillis = defaultMaxWaitMillis;
     }
 
     /**
@@ -280,12 +281,12 @@ public class PerUserPoolDataSource
      * throwing an exception, or -1 to wait indefinitely.  Will fail 
      * immediately if value is 0.
      * The keys are usernames and the value is the maximum connections.  Any 
-     * username specified here will override the value of defaultMaxWait.
+     * username specified here will override the value of defaultMaxWaitMillis.
      */
-    public Integer getPerUserMaxWait(String username) {
+    public Integer getPerUserMaxWaitMillis(String username) {
         Integer value = null;
-        if (perUserMaxWait != null) {
-            value = perUserMaxWait.get(username);
+        if (perUserMaxWaitMillis != null) {
+            value = perUserMaxWaitMillis.get(username);
         }
         return value;
     }
@@ -296,14 +297,14 @@ public class PerUserPoolDataSource
      * throwing an exception, or -1 to wait indefinitely.  Will fail 
      * immediately if value is 0.
      * The keys are usernames and the value is the maximum connections.  Any 
-     * username specified here will override the value of defaultMaxWait.
+     * username specified here will override the value of defaultMaxWaitMillis.
      */
-    public void setPerUserMaxWait(String username, Integer value) {
+    public void setPerUserMaxWaitMillis(String username, Integer value) {
         assertInitializationAllowed();
-        if (perUserMaxWait == null) {
-            perUserMaxWait = new HashMap<String,Integer>();
+        if (perUserMaxWaitMillis == null) {
+            perUserMaxWaitMillis = new HashMap<String,Integer>();
         }
-        perUserMaxWait.put(username, value);
+        perUserMaxWaitMillis.put(username, value);
     }
 
     /**
@@ -509,9 +510,9 @@ public class PerUserPoolDataSource
         userMax = getPerUserMaxIdle(username);
         int maxIdle =  (userMax == null) ?
             getDefaultMaxIdle() : userMax.intValue();
-        userMax = getPerUserMaxWait(username);
-        int maxWait = (userMax == null) ?
-            getDefaultMaxWait() : userMax.intValue();
+        userMax = getPerUserMaxWaitMillis(username);
+        int maxWaitMillis = (userMax == null) ?
+            getDefaultMaxWaitMillis() : userMax.intValue();
 
         // Set up the factory we will use (passing the pool associates
         // the factory with the pool, so we do not have to do so
@@ -526,12 +527,12 @@ public class PerUserPoolDataSource
         factory.setPool(pool);
         pool.setMaxTotal(maxTotal);
         pool.setMaxIdle(maxIdle);
-        pool.setMaxWait(maxWait);
+        pool.setMaxWaitMillis(maxWaitMillis);
         if (maxTotal <= 0) {
             pool.setBlockWhenExhausted(false);
             pool.setMaxTotal(Integer.MAX_VALUE);
         }
-        if (maxWait == 0) {
+        if (maxWaitMillis == 0) {
             pool.setBlockWhenExhausted(false);
         }
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java
Wed Apr 25 09:49:22 2012
@@ -56,9 +56,9 @@ public class PerUserPoolDataSourceFactor
                 Integer.parseInt(ra.getContent().toString()));
         }
 
-        ra = ref.get("defaultMaxWait");
+        ra = ref.get("defaultMaxWaitMillis");
         if (ra != null && ra.getContent() != null) {
-            pupds.setDefaultMaxWait(
+            pupds.setDefaultMaxWaitMillis(
                 Integer.parseInt(ra.getContent().toString()));
         }
 
@@ -90,10 +90,10 @@ public class PerUserPoolDataSourceFactor
                 (Map<String,Integer>) deserialize(serialized);
         }
         
-        ra = ref.get("perUserMaxWait");
+        ra = ref.get("perUserMaxWaitMillis");
         if (ra != null  && ra.getContent() != null) {
             byte[] serialized = (byte[]) ra.getContent();
-            pupds.perUserMaxWait =
+            pupds.perUserMaxWaitMillis =
                 (Map<String,Integer>) deserialize(serialized);
         }
                 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
Wed Apr 25 09:49:22 2012
@@ -56,8 +56,8 @@ public class SharedPoolDataSource
 
     private int maxTotal = GenericObjectPoolConfig.DEFAULT_MAX_TOTAL;
     private int maxIdle = GenericObjectPoolConfig.DEFAULT_MAX_IDLE;
-    private int maxWait = (int)Math.min(Integer.MAX_VALUE,
-            GenericObjectPoolConfig.DEFAULT_MAX_WAIT);
+    private int maxWaitMillis = (int)Math.min(Integer.MAX_VALUE,
+            GenericObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS);
     private transient KeyedObjectPool<UserPassKey,PooledConnectionAndInfo> pool = null;
     private transient KeyedCPDSConnectionFactory factory = null;
 
@@ -124,8 +124,8 @@ public class SharedPoolDataSource
      * immediately if value is 0.
      * The default is -1.
      */
-    public int getMaxWait() {
-        return (this.maxWait);
+    public int getMaxWaitMillis() {
+        return (this.maxWaitMillis);
     }
 
     /**
@@ -135,9 +135,9 @@ public class SharedPoolDataSource
      * immediately if value is 0.
      * The default is -1.
      */
-    public void setMaxWait(int maxWait) {
+    public void setMaxWaitMillis(int maxWaitMillis) {
         assertInitializationAllowed();
-        this.maxWait = maxWait;
+        this.maxWaitMillis = maxWaitMillis;
     }
 
     // ----------------------------------------------------------------------
@@ -219,13 +219,13 @@ public class SharedPoolDataSource
         GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
         config.setMaxTotalPerKey(getMaxTotal());
         config.setMaxIdlePerKey(getMaxIdle());
-        config.setMaxWait(getMaxWait());
+        config.setMaxWaitMillis(getMaxWaitMillis());
         config.setBlockWhenExhausted(true);
         if (maxTotal <= 0) {
             config.setBlockWhenExhausted(false);
             config.setMaxTotalPerKey(Integer.MAX_VALUE);
         }
-        if (maxWait == 0) {
+        if (maxWaitMillis == 0) {
             config.setBlockWhenExhausted(false);
         }
         config.setTestOnBorrow(getTestOnBorrow());

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java
Wed Apr 25 09:49:22 2012
@@ -50,9 +50,9 @@ public class SharedPoolDataSourceFactory
                 Integer.parseInt(ra.getContent().toString()));
         }
 
-        ra = ref.get("maxWait");
+        ra = ref.get("maxWaitMillis");
         if (ra != null && ra.getContent() != null) {
-            spds.setMaxWait(
+            spds.setMaxWaitMillis(
                 Integer.parseInt(ra.getContent().toString()));
         }
         

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java
Wed Apr 25 09:49:22 2012
@@ -66,7 +66,7 @@ public class PoolableManagedConnectionFa
             GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
             config.setMaxTotalPerKey(-1);
             config.setBlockWhenExhausted(false);
-            config.setMaxWait(0);
+            config.setMaxWaitMillis(0);
             config.setMaxIdlePerKey(1);
             config.setMaxTotal(maxOpenPreparedStatements);
             KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> stmtPool =

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSource.java Wed
Apr 25 09:49:22 2012
@@ -58,7 +58,7 @@ public class TestBasicDataSource extends
         ds.setDriverClassName("org.apache.commons.dbcp2.TesterDriver");
         ds.setUrl("jdbc:apache:commons:testdriver");
         ds.setMaxTotal(getMaxTotal());
-        ds.setMaxWait(getMaxWait());
+        ds.setMaxWaitMillis(getMaxWait());
         ds.setDefaultAutoCommit(true);
         ds.setDefaultReadOnly(false);
         ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
@@ -486,7 +486,7 @@ public class TestBasicDataSource extends
         ds.setDriverClassName("org.apache.commons.dbcp2.TesterDriver");
         ds.setUrl("jdbc:apache:commons:testdriver");
         ds.setMaxTotal(getMaxTotal());
-        ds.setMaxWait(getMaxWait());
+        ds.setMaxWaitMillis(getMaxWait());
         ds.setDefaultAutoCommit(true);
         ds.setDefaultReadOnly(false);
         ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Wed Apr 25 09:49:22 2012
@@ -89,7 +89,7 @@ public class TestBasicDataSourceFactory 
         assertEquals(10, ds.getMaxTotal());
         assertEquals(8, ds.getMaxIdle());
         assertEquals(0, ds.getMinIdle());
-        assertEquals(500, ds.getMaxWait());
+        assertEquals(500, ds.getMaxWaitMillis());
         assertEquals(5, ds.getInitialSize());
         assertEquals(5, ds.getNumIdle());
         assertEquals(true, ds.getDefaultAutoCommit());

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDataSource.java
Wed Apr 25 09:49:22 2012
@@ -63,7 +63,7 @@ public class TestPoolingDataSource exten
         pool = new GenericObjectPool(factory);
         factory.setPool(pool);
         pool.setMaxTotal(getMaxTotal());
-        pool.setMaxWait(getMaxWait());
+        pool.setMaxWaitMillis(getMaxWait());
         ds = new PoolingDataSource(pool);
         ds.setAccessToUnderlyingConnectionAllowed(true);
     }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java Wed
Apr 25 09:49:22 2012
@@ -67,7 +67,7 @@ public class TestPoolingDriver extends T
 
         GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
         poolConfig.setMaxTotal(getMaxTotal());
-        poolConfig.setMaxWait(getMaxWait());
+        poolConfig.setMaxWaitMillis(getMaxWait());
         poolConfig.setMinIdle(10);
         poolConfig.setTestOnBorrow(true);
         poolConfig.setTestOnReturn(true);
@@ -137,7 +137,7 @@ public class TestPoolingDriver extends T
     public void testReportedBug12400() throws Exception {
         GenericObjectPoolConfig config = new GenericObjectPoolConfig();
         config.setMaxTotal(70);
-        config.setMaxWait(60000);
+        config.setMaxWaitMillis(60000);
         config.setMaxIdle(10);
         ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
             "jdbc:apache:commons:testdriver", 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
Wed Apr 25 09:49:22 2012
@@ -66,7 +66,7 @@ public class TestCPDSConnectionFactory e
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        ds.setConnectionPoolDataSource(cpds);
        ds.setPerUserMaxTotal("username",new Integer(10));// Integer.valueOf() is Java 1.5
-       ds.setPerUserMaxWait("username",new Integer(50));
+       ds.setPerUserMaxWaitMillis("username",new Integer(50));
        ds.setPerUserMaxIdle("username",new Integer(2));
        Connection conn1 = ds.getConnection("username", "password");
        Connection conn2 = ds.getConnection("username", "password");

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
Wed Apr 25 09:49:22 2012
@@ -67,7 +67,7 @@ public class TestKeyedCPDSConnectionFact
        SharedPoolDataSource ds = new SharedPoolDataSource();
        ds.setConnectionPoolDataSource(cpds);
        ds.setMaxTotal(10);
-       ds.setMaxWait(50);
+       ds.setMaxWaitMillis(50);
        ds.setMaxIdle(2);
        Connection conn1 = ds.getConnection("username", "password");
        Connection conn2 = ds.getConnection("username", "password");

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
Wed Apr 25 09:49:22 2012
@@ -69,9 +69,9 @@ public class TestPerUserPoolDataSource e
         PerUserPoolDataSource tds = new PerUserPoolDataSource();
         tds.setConnectionPoolDataSource(pcds);
         tds.setDefaultMaxTotal(getMaxTotal());
-        tds.setDefaultMaxWait((int)(getMaxWait()));
+        tds.setDefaultMaxWaitMillis((int)(getMaxWait()));
         tds.setPerUserMaxTotal("foo",new Integer(getMaxTotal()));
-        tds.setPerUserMaxWait("foo",new Integer((int)(getMaxWait())));
+        tds.setPerUserMaxWaitMillis("foo",new Integer((int)(getMaxWait())));
         tds.setDefaultTransactionIsolation(
             Connection.TRANSACTION_READ_COMMITTED);
 
@@ -332,7 +332,7 @@ public class TestPerUserPoolDataSource e
      */
     public void testMaxWaitZero() throws Exception {
         PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
-        tds.setDefaultMaxWait(0);
+        tds.setDefaultMaxWaitMillis(0);
         tds.setPerUserMaxTotal("u1", new Integer(1));
         Connection conn = tds.getConnection("u1", "p1");
         try {
@@ -397,15 +397,15 @@ public class TestPerUserPoolDataSource e
         // Override wait time in order to allow for Thread.sleep(1) sometimes taking a lot
longer on
         // some JVMs, e.g. Windows.
         final int defaultMaxWait = 430;
-        ((PerUserPoolDataSource) ds).setDefaultMaxWait(defaultMaxWait);
-        ((PerUserPoolDataSource) ds).setPerUserMaxWait("foo",new Integer(defaultMaxWait));
+        ((PerUserPoolDataSource) ds).setDefaultMaxWaitMillis(defaultMaxWait);
+        ((PerUserPoolDataSource) ds).setPerUserMaxWaitMillis("foo",new Integer(defaultMaxWait));
         multipleThreads(1, false, false, defaultMaxWait);
     }
 
     public void testMultipleThreads2() throws Exception {
         final int defaultMaxWait = 500;
-        ((PerUserPoolDataSource) ds).setDefaultMaxWait(defaultMaxWait);
-        ((PerUserPoolDataSource) ds).setPerUserMaxWait("foo",new Integer(defaultMaxWait));
+        ((PerUserPoolDataSource) ds).setDefaultMaxWaitMillis(defaultMaxWait);
+        ((PerUserPoolDataSource) ds).setPerUserMaxWaitMillis("foo",new Integer(defaultMaxWait));
         multipleThreads(2 * defaultMaxWait, true, true, defaultMaxWait);
     }
 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java
Wed Apr 25 09:49:22 2012
@@ -67,7 +67,7 @@ public class TestSharedPoolDataSource ex
         SharedPoolDataSource tds = new SharedPoolDataSource();
         tds.setConnectionPoolDataSource(pcds);
         tds.setMaxTotal(getMaxTotal());
-        tds.setMaxWait((int)(getMaxWait()));
+        tds.setMaxWaitMillis((int)(getMaxWait()));
         tds.setDefaultTransactionIsolation(
             Connection.TRANSACTION_READ_COMMITTED);
 
@@ -344,7 +344,7 @@ public class TestSharedPoolDataSource ex
         final int maxWait = 1000;
         final int theadCount = 20;
         
-        ((SharedPoolDataSource)ds).setMaxWait(maxWait);
+        ((SharedPoolDataSource)ds).setMaxWaitMillis(maxWait);
         // Obtain all the connections from the pool
         Connection[] c = new Connection[getMaxTotal()];
         for (int i=0; i<c.length; i++) {
@@ -388,13 +388,13 @@ public class TestSharedPoolDataSource ex
         // Override wait time in order to allow for Thread.sleep(1) sometimes taking a lot
longer on
         // some JVMs, e.g. Windows.
         final int defaultMaxWait = 430;
-        ((SharedPoolDataSource) ds).setMaxWait(defaultMaxWait);
+        ((SharedPoolDataSource) ds).setMaxWaitMillis(defaultMaxWait);
         multipleThreads(1, false, false, defaultMaxWait);
     }
 
     public void testMultipleThreads2() throws Exception {
         final int defaultMaxWait = 500;
-        ((SharedPoolDataSource) ds).setMaxWait(defaultMaxWait);
+        ((SharedPoolDataSource) ds).setMaxWaitMillis(defaultMaxWait);
         multipleThreads(2 * defaultMaxWait, true, true, defaultMaxWait);
     }
 
@@ -494,7 +494,7 @@ public class TestSharedPoolDataSource ex
         SharedPoolDataSource tds = new SharedPoolDataSource();
         tds.setConnectionPoolDataSource(mypcds);
         tds.setMaxTotal(getMaxTotal());
-        tds.setMaxWait((int)(getMaxWait()));
+        tds.setMaxWaitMillis((int)(getMaxWait()));
         tds.setDefaultTransactionIsolation(
             Connection.TRANSACTION_READ_COMMITTED);
 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java?rev=1330174&r1=1330173&r2=1330174&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
Wed Apr 25 09:49:22 2012
@@ -84,7 +84,7 @@ public class TestManagedDataSource exten
         pool = new GenericObjectPool(factory);
         factory.setPool(pool);
         pool.setMaxTotal(getMaxTotal());
-        pool.setMaxWait(getMaxWait());
+        pool.setMaxWaitMillis(getMaxWait());
 
         // finally create the datasource
         ds = new ManagedDataSource(pool, xaConnectionFactory.getTransactionRegistry());



Mime
View raw message