tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1054824 - in /tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test: AlternateUsernameTest.java driver/Driver.java
Date Mon, 03 Jan 2011 23:28:42 GMT
Author: fhanik
Date: Mon Jan  3 23:28:42 2011
New Revision: 1054824

URL: http://svn.apache.org/viewvc?rev=1054824&view=rev
Log:
one 0 too many on username test
make sure the driver correctly checks url

Modified:
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/AlternateUsernameTest.java
    tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/AlternateUsernameTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/AlternateUsernameTest.java?rev=1054824&r1=1054823&r2=1054824&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/AlternateUsernameTest.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/AlternateUsernameTest.java
Mon Jan  3 23:28:42 2011
@@ -34,12 +34,12 @@ import org.apache.tomcat.jdbc.test.drive
 
 public class AlternateUsernameTest extends DefaultTestCase {
 
-    private static final int iterations = (new Random(System.currentTimeMillis())).nextInt(10000000)+100000;
+    private static final int iterations = (new Random(System.currentTimeMillis())).nextInt(1000000)+100000;
     public AlternateUsernameTest(String name) {
         super(name);
     }
     
-    public void testGeneric() throws Exception {
+    public void testUsernameCompare() throws Exception {
         
         this.init();
         this.datasource.setDriverClassName(Driver.class.getName());
@@ -74,6 +74,10 @@ public class AlternateUsernameTest exten
 
     }
     
+    public void testUsernameCompareAgain() throws Exception {
+        testUsernameCompare();
+    }
+    
     public static class TestResult {
         public int iterations;
         public int failures;

Modified: tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java?rev=1054824&r1=1054823&r2=1054824&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java (original)
+++ tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/driver/Driver.java Mon
Jan  3 23:28:42 2011
@@ -46,7 +46,7 @@ public class Driver implements java.sql.
     }
     
     public boolean acceptsURL(String url) throws SQLException {
-        return url == Driver.url;
+        return url!=null && url.equals(Driver.url);
     }
 
     public Connection connect(String url, Properties info) throws SQLException {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message