commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r883848 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp: TestDriverManagerConnectionFactory.java datasources/TestCPDSConnectionFactory.java
Date Tue, 24 Nov 2009 20:15:31 GMT
Author: sebb
Date: Tue Nov 24 20:15:30 2009
New Revision: 883848

URL: http://svn.apache.org/viewvc?rev=883848&view=rev
Log:
Allow tests to compile under Java 1.4

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDriverManagerConnectionFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestCPDSConnectionFactory.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDriverManagerConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDriverManagerConnectionFactory.java?rev=883848&r1=883847&r2=883848&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDriverManagerConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDriverManagerConnectionFactory.java
Tue Nov 24 20:15:30 2009
@@ -71,7 +71,7 @@
             threads[i].start();
         }
         for (int i = 0; i < 10; i++) {
-            while (threads[i].getState() != Thread.State.TERMINATED) {
+            while (threads[i].isAlive()){//JDK1.5: getState() != Thread.State.TERMINATED)
{
                 Thread.sleep(100);
             }
             if (!connectionThreads[i].getResult()) {

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestCPDSConnectionFactory.java?rev=883848&r1=883847&r2=883848&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestCPDSConnectionFactory.java
Tue Nov 24 20:15:30 2009
@@ -64,9 +64,9 @@
     public void testSharedPoolDSDestroyOnReturn() throws Exception {
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        ds.setConnectionPoolDataSource(cpds);
-       ds.setPerUserMaxActive("username",Integer.valueOf(10));
-       ds.setPerUserMaxWait("username",Integer.valueOf(50));
-       ds.setPerUserMaxIdle("username",Integer.valueOf(2));
+       ds.setPerUserMaxActive("username",new Integer(10));// Integer.valueOf() is Java 1.5
+       ds.setPerUserMaxWait("username",new Integer(50));
+       ds.setPerUserMaxIdle("username",new Integer(2));
        Connection conn1 = ds.getConnection("username", "password");
        Connection conn2 = ds.getConnection("username", "password");
        Connection conn3 = ds.getConnection("username", "password");



Mime
View raw message